Humans

Run Settings
LanguageJava
Language Version
Run Command
class Main { public static void main(String[] args) { Human h1 = new Human("brown","Hello World",25); Human h2 = new Human("blue","Howdy there, World",50); System.out.println(h1.getGreeting() + ", I am " + h1.getAge() + " years old."); System.out.println(h2.getGreeting() + ", I am " + h2.getAge() + " years old."); } }
public class Human { String eyeColor; String greeting; int age; Human (String eyeColor, String greeting, int age) { setEyeColor(eyeColor); setGreeting(greeting); setAge(age); } public void setEyeColor (String eyeColor) { this.eyeColor = eyeColor; } public String getEyeColor () { return this.eyeColor; } public void setGreeting (String greeting) { this.greeting = greeting; } public String getGreeting () { return this.greeting; } public void setAge (int age) { this.age = age; } public int getAge () { return this.age; } }
Editor Settings
Theme
Key bindings
Full width
Lines