-
Person.java
public class Person { private String name; private int age; public Person(String name, int age) { this.name = name; this.age = age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } }
-
Circle.java
public class Circle { private double radius; private double area; public Circle(double radius) { this.radius = radius; this.area = Math.PI * radius * radius; } public double getRadius() { return radius; } public void setRadius(double radius) { this.radius = radius; this.area = Math.PI * radius * radius; } public double getArea() { return area; } }
-
Student.java
public class Student { private int id; private String name; private double score; public Student(int id, String name, double score) { this.id = id; this.name = name; this.score = score; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getScore() { return score; } public void setScore(double score) { this.score = score; } }
-
BankAccount.java
public class BankAccount { private int accountNumber; private String name; private double balance; public BankAccount(int accountNumber, String name, double balance) { this.accountNumber = accountNumber; this.name = name; this.balance = balance; } public int getAccountNumber() { return accountNumber; } public void setAccountNumber(int accountNumber) { this.accountNumber = accountNumber; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getBalance() { return balance; } public void setBalance(double balance) { this.balance = balance; } }
-
Rectangle.java
public class Rectangle { private double length; private double width; public Rectangle(double length, double width) { this.length = length; this.width = width; } public double getLength() { return length; } public void setLength(double length) { this.length = length; } public double getWidth() { return width; } public void setWidth(double width) { this.width = width; } }
-
Movie.java
public class Movie { private String name; private String director; private String[] actors; public Movie(String name, String director, String[] actors) { this.name = name; this.director = director; this.actors = actors; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDirector() { return director; } public void setDirector(String director) { this.director = director; } public String[] getActors() { return actors; } public void setActors(String[] actors) { this.actors = actors; } }
-
Book.java
public class Book { private String title; private String author; private String publisher; public Book(String title, String author, String publisher) { this.title = title; this.author = author; this.publisher = publisher; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } public String getPublisher() { return publisher; } public void setPublisher(String publisher) { this.publisher = publisher; } }
-
Computer.java
public class Computer { private String brand; private String model; private double screenSize; public Computer(String brand, String model, double screenSize) { this.brand = brand; this.model = model; this.screenSize = screenSize; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } public double getScreenSize() { return screenSize; } public void setScreenSize(double screenSize) { this.screenSize = screenSize; } }
-
Car.java
public class Car { private String brand; private String model; private String color; public Car(String brand, String model, String color) { this.brand = brand; this.model = model; this.color = color; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } }
-
Person.java
public class Person { private String name; private String address; private String phoneNumber; public Person(String name, String address, String phoneNumber) { this.name = name; this.address = address; this.phoneNumber = phoneNumber; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } }
Created
February 26, 2023 03:57
-
-
Save YuenSzeHong/e4ee20a0a9aca5cf5461b094150cba1e to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment