Last active
May 11, 2016 11:10
-
-
Save vojtechruz/7491ef6d99569a55cabfe2543cbe4354 to your computer and use it in GitHub Desktop.
Example of JavaBeans Convention
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Person john = new Person(); | |
john.setFirstName("John"); | |
john.setLastName("Smith"); | |
john.setAge(33); | |
john.setDescription("I am a huge fan on JavaBeans convention!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person implements Serializable { | |
private String firstName; | |
private String lastName; | |
private int age; | |
private String description; | |
public Person() { | |
} | |
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 String getDescription() { | |
return description; | |
} | |
public void setDescription(String description) { | |
this.description = description; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment