Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package com.rubaka.students_arraylist;
public class Student
{
private String firstName;
private String lastName;
private int age;
private double weight;
private char profession;
Student(){}
Student(String firstName, String lastName){
this.firstName = firstName;
this.lastName = lastName;
}
public String getFirstName()
{
return firstName;
}
public void setFirstName( String firstName )
{
this.firstName = firstName;
}
public String getLastName()
{
return lastName;
}
public void setLastName( String lastName )
{
this.lastName = lastName;
}
public int getAge()
{
return age;
}
public void setAge( int age )
{
this.age = age;
}
public double getWeight()
{
return weight;
}
public void setWeight( double weight )
{
this.weight = weight;
}
public char getProfession()
{
return profession;
}
public void setProfession( char profession )
{
this.profession = profession;
}
public String toString(){
return firstName + " " + lastName + ", " + age + ", profession: " + profession + ", weight: " + weight;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.