
class Person {
	 String name;
	 int age;
	 void speak() {
		System.out.println(
			"My name is : " + this.name + " and my age is " + this.age); 
	 }
}

public class JavaClass {
	public static void main(String[] args) {
		Person person = new Person();
		person.name = "Ian";
		person.age = 30;
		System.out.println("Name: " + person.name);
		System.out.println("Age: " + person.age);
		person.speak();
	}
}

@@ -1,8 +1,685 @@
+class Machine %7B%0A%09private String name;%0A%09private int age;%0A%09%0A%09public Machine(String name) %7B%0A%09%09this.name = name;%0A%09%7D%0A%09%0A%09public Machine(String name, int age) %7B%0A%09%09this.name = name;%0A%09%09this.age = age;%0A%09%7D%0A%09%0A%09public void getName() %7B%0A%09%09System.out.println(%22Name: %22 + this.name);%0A%09%7D%0A%09%0A%09public void getNameAge() %7B%0A%09%09System.out.println(%22Name: %22 + this.name + %22 Age: %22 + this.age);%0A%09%7D%0A%7D%0A%0Aclass Robot %7B%0A%09public void speak(String text) %7B%0A%09%09System.out.println(text );%0A%09%7D%0A%09%0A%09public void jump(int height) %7B%0A%09%09System.out.println(%22Jumping: %22 + height);%0A%09%7D%0A%09%0A%09public void move(String direction, double distance) %7B%0A%09%09System.out.println(%22Moving %22 + distance + %22 meters in direction %22 + direction);%0A%09%7D%0A%7D%0A 
 %0Aclass P
@@ -688,16 +688,24 @@
 son %7B%0A%09 
+private 
 String n
@@ -711,16 +711,24 @@
 name;%0A%09 
+private 
 int age;
@@ -836,16 +836,344 @@
 ); %0A%09 %7D%0A
+%09 int calculateYearsToRetirement() %7B%0A%09%09 int yearsLeft = 65 - this.age;%0A%09%09 return yearsLeft;%0A%09 %7D%0A%09 %0A%09 public String getName() %7B%0A%09%09 return name;%0A%09 %7D%0A%09 %0A%09 public int getAge() %7B%0A%09%09 return age;%0A%09 %7D%0A%09 %0A%09 public void setName(String newName) %7B%0A%09%09 this.name = newName;%0A%09 %7D%0A%09 %0A%09 public void setAge(int newAge) %7B%0A%09%09 this.age = newAge;%0A%09 %7D%0A
 %7D%0A%0Apubli
@@ -1266,16 +1266,18 @@
 rson();%0A
+//
 %09%09person
@@ -1291,16 +1291,18 @@
  %22Ian%22;%0A
+//
 %09%09person
@@ -1312,16 +1312,18 @@
 e = 30;%0A
+//
 %09%09System
@@ -1360,16 +1360,18 @@
 .name);%0A
+//
 %09%09System
@@ -1423,14 +1423,460 @@
 speak();
+ %0A%09%09System.out.println(person.calculateYearsToRetirement());%0A%09%09person.setName(%22kosen%22);%0A%09%09person.setAge(50);%0A%09%09System.out.println(%22Name: %22 + person.getName());%0A%09%09System.out.println(%22Age: %22 + person.getAge());%0A%09%09%0A%09%09%0A%09%09Robot sam = new Robot();%0A%09%09sam.speak(%22Hi I am Sam.%22);%0A%09%09sam.jump(89);%0A%09%09sam.move(%22West%22, 12.4);%0A%09%09%0A%09%09Machine m_one = new Machine(%22Koko%22);%0A%09%09m_one.getName();%0A%09%09%0A%09%09Machine m_two = new Machine(%22Matope%22, 90);%0A%09%09m_two.getNameAge();%0A%09%09
 %0A%09%7D%0A%7D%0A

Add constructor