I am very new to programming in Java. Can anyone take this code and add comments ( // ) so I can better understand what each line does?
class TestNumber // creates Class named TestNumber { public static void main(String[] args) // This is the main method { Number n1 = new Number(10); // To my understanding, this will create an object n1 and assign 10 to that object? Number n2 = new Number(20); Number n3 = n1.add(n2); System.out.println("n3 = " + n3.toString()); } } //================================================ class Number { private int x; //---------------------------------- public Number(int xx) { x = xx; } //---------------------------------- public Number add(Number r) { return new Number(x + r.x); } //---------------------------------- public String toString() { return "" + x; // return value in x as String } }