Monday, 13 October 2014

Java Interview Questions

Java Basics:


Java can be used to create all kinds of software applications. The Java divided into 3 modules. They are 
  1. JSE - Java Standard Edition
  2. JEE - Java Enterprise Edition
  3. JME - Java Mobile/Micro Edition
Java is the plotform independent language means once if we make application in one operating system like windows, linux or Macintosh we can run in any other operating system by using JVM(Java Virtual Machine). Java is purely Object oriented programming language.

JSE: Java Standard Edition

Can be download from http://www.oracle.com/technetwork/java/javase/downloads/index.html.

By using this We can develop desktop applications.

JEE: Java Enterprise Edition

JEE is not a software it's a specification to develop server side application i.e dynamic websites. For Developing Server side application we are using IDE(Integration Development Environment) like Netbeans, Eclipse etc. And the Servers are Apache Tomcat, Weblogic, Websphere etc.,

JME: Java Mobile/Micro Edition

JME can be used to make the Mobile applications.  For JEE and JME modules JSE module is the base module.

Sample Java Program:

class TestJava{
      String message = "Welcome To javaWorld!!";
       public static void main(){
            System.out.println(message);
        }
}

Here the JVM always search for main() method. If it find then the statements will be executed. Otherwise NoSuchMethodError: main Runtime Exception will be occured.

In the above sample program

TestJava - class Name
main() - Function name or Method name
message - variable or property of TestJava Class
public - this access specifier indicated that the main() method can be call from anywhere.
static - this modifier specifies that without creating object JVM can directly call main() method
void - main() method can't return any value to JVM

No comments:

Post a Comment