Question : 1)What are the actual functions of JVM? 2)When to use a class and when to use an Abstract class? 3)what is the use of constructors other than creation of objects? 4)when to use constructors? 5)when to use Interface? 6)why java does not support pointers? 7)why multiple inheritance is not possible in java without using Interfaces?
Various function are performed by JVM like garbage collection ,loading class, interpretation of bytecode. Main funtion of JVM is to provide the interfacing between hardware & our JAVA program.It is the platform for execution of JAVA bytecode.
1) To work with any java pgm we need to have JVM installed.It will interpret the java API to underlying hardware.
2)When you dont want to instantiate object for a class declare that class as Abstract. whose methods can be overridden only in the subclass which extends it.
3)Constructors are used for initializing values to data members. which has no return values but same name as that of the class name.
5)Java does not support multiple inheritance.to overcome that we use interface
6)Pointer is a variable that holds address of another variable.It is possible for pointers to hold address of a variable that lies outside java environment which breaches the firewall of java environment
7)Multiple inheritance has got 2 disadvantages gives rise to ambiguities.to overcome all that java doesnot support multiple inheritance.
5)when to use Interface? Interface is used instead of multiple inheritance.because multiple inheritance not support in java. By using interface we can implements more than one class through implements keyword.
While developing one in JSP page we are sending request to Struts frame work.If we click two times submit button then First time only it should accept request and second time should reject that request in struts frame work.
How we can do that in controller itself...I am waiting for your Response...