Hi.
I started java programming few weeks ago. Im trying to understand how java objects, variable and main program stored inside heap and stack.
I marked with question marks for places where i want to know. Please help me to understand.
class Student{ int age; // ? String name; // ? public Student() // ? { this.age = 0; name = "Anonymous"; } public Student(int Age, String Name) // Parameter int Age and String Name ? { this.age = Age; setName(Name); } public void setName(String Name) // method and parameter ? { this.name = Name; } } public class Main{ public static void main(String[] args) { // public method ? Student s; // ? s = new Student(23,"Jonh"); int noStudents = 1; //local variable } }