Java Interview Questions
1)Why pointeres are eliminated from java.? Ans) 1.Pointers lead to confusion for a programmer. 2. Pointers may crash a program easily, for example , when we add two pointers, the program crashers immediately. 3. Pointers break security. Using pointers, harmful programs like Virus and other hacking programs can be developed. Because of the above reasons, pointers have been eliminated from java. 2) What is the difference between a function and a method.? Ans). A method is a function that is written in a class. We do not have functions in java; instead we have methods. This means whenever a function is written in java,it should be written inside the class only. But if we take C++, we can write the funtions inside as well as outside the class . So in C++, they are called member funcitons and not methods. 3) Which part of JVM will allocate the memory for a java program.? Ans). Class loader subsystem of JVM will allocate the necessary memory needed by the java progr...