Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Person() {}
- public int getAge() {
- return age;
- }
- public void setAge(int age) {
- this.age = age;
- }
- public double getHeight() {
- return height;
- }
- public void setHeight(double height) {
- this.height = height;
- }
- public double getWeight() {
- return weight;
- }
- public void setWeight(double weight) {
- this.weight = weight;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getGender() {
- return gender;
- }
- public void setGender(String gender) {
- this.gender = gender;
- }
- public static void buildFromFile(String location) throws FileNotFoundException{
- File file = new File(location);
- Scanner input = new Scanner(file);
- while(input.hasNextLine()) {
- String data = input.nextLine();
- for(int i = 0; i <= people.length; i++) {
- people[i].setName(data);
- }
- }
- for(int i = 0; i <= people.length; i++) {
- System.out.println(people[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement