Skip to content

Instantly share code, notes, and snippets.

@AnatoliiStepaniuk
Created January 21, 2016 19:06
Show Gist options
  • Save AnatoliiStepaniuk/1f97eeef8089d292f0dc to your computer and use it in GitHub Desktop.
Save AnatoliiStepaniuk/1f97eeef8089d292f0dc to your computer and use it in GitHub Desktop.
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