Last active
December 23, 2015 01:09
-
-
Save kennycason/6558413 to your computer and use it in GitHub Desktop.
Ryosuke's first code.java
This file contains hidden or 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 abstract class Person { | |
private String name; | |
private int age; | |
private Boolean gender; | |
public Person(){ | |
name = "john"; | |
age = 0; | |
gender = true; | |
} | |
public Person(String name, int age, Boolean gender){ | |
this.name = name; | |
this.age = age; | |
this.gender = gender; | |
} | |
public String getName(){ | |
return name; | |
} | |
public void setName(String name){ | |
this.name = name; | |
} | |
public String getIdeology(){ | |
if((age > 20) && (name.charAt(0) == 'A') && (gender == false)){ | |
return "Liberal"; | |
} | |
return ""; | |
} | |
} | |
public class Kenny extends Person { | |
public Kenny(){ | |
super("kenny", 27, true); | |
} | |
public Boolean isStupid(){ | |
return true; | |
} | |
} | |
public class Ryosuke extends Person { | |
private String Nationarity; | |
public Ryosuke(){ | |
super("Ryosuke",23,false); | |
this.Nationarity = new String("Japan"); | |
this.Nationarity = "Japanese"; | |
} | |
public Boolean smarterthankenny(){ | |
} | |
return true; | |
} | |
} | |
@Test | |
public void kennyTest() { | |
Kenny k; | |
Ryosuke r; | |
r.smarterthankenny(); | |
String kennysName = k.getName(); | |
assertEquals(true, k.isStupd()); | |
} |
Haha I know right. Not bad for his first program
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cute