Instantly share code, notes, and snippets.

Embed
What would you like to do?
Demonstration code for the blog post 'Inheritance Part 1 - That Class is Super!'
package com.oopuniversity.basics.classes;
/**
* Created by OOPUniversity on 11/15/2015.
*/
public class Person {
private String firstName;
private String lastName;
public Person(String newFirstName, String newLastName) {
firstName = newFirstName;
lastName = newLastName;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String newFirstName) {
firstName = newFirstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String newLastName) {
lastName = newLastName;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment