(JAVA) Is is correct how I describe each part where will be stored?
Hello everyone, I have a code and I should define where each part is stored, 1- Method Area 2- Heap 3- Stack so I wrote it down and wanted to check with you if it is correct or needs some correction, please help me understand it. The code is the following ______________________________________________________________________ public class TestStudent { static Student studentA; static Student studentB; static Student studentC; public static void main(String[] args) { studentA = new Student("Mark", "John", "Jimmy"); studentB = new Student("Will", "George", "Androw"); studentC = new Student("Frank", "Sam"); int totalStudents = Student.getTotalStudents(); System.out.println(totalStudents + " is 3"); System.out.println(studentA.getFirstName() + " is Mark"); studentA.setFirstName("Richard"); System.out.println(studentA.getFirstName() + " is Richard"); } _____________________________________________________________________ Here is my definition of each part and where will be stored: - The whole byte code will be stored in the Method Area - The class TestStudent will be stored in the Method Area - The Global Variables studentA, studentB, and studentC will be stored in the Stack - class main will be stored in the Method Area as well - The objects studentA, studentB, and studentC will be stored in the Heap - The result of totalStudents studentA.getFirstName() and the new result of studentA.getFirstName() both will be stored in the Stack - This new object studentA will be stored in the Heap _____________________________________________________________________ Thanks in advance