What actually happens when an object of a class is created in Java ?
class Student{
public static void main(String [] args){
Student s1; // Reference s1 is created in the stack
s1 = new Studnet(); // Mermory is allocated to s1 in heap
}
}
The first statement states that reference (s1) is crea...
codetrekclub.hashnode.dev1 min read