Created
November 15, 2015 16:34
-
-
Save OOPUniversity/9a8179b0333bd0293c20 to your computer and use it in GitHub Desktop.
Demonstration code for the blog post 'Inheritance Part 1 - That Class is Super!'
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
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