Java Programming language is developed by James Gosling at Sun Micro System in the year 1995. It is a simple, portable, architecture-neutral, platform-independent, and object-oriented programming language.
Why Java is Portable?
Java is known as a Portable language because we can execute the Java code on all major platforms. After compilation, your Java source code gets converted into byte code having a .class extension, and those files can be used on any Java-supported platform without any modification.
Why Java is called an Architecture-neutral language?
Java is called Architecture neutral because the Java program can run on any processor irrespective of its vendor or architecture. It allows its application to compile on one hardware architecture and to execute on another hardware architecture.
Why Java is called Platform Independent?
Java is called platform-independent because it can be executed on several platforms and does not depend on any type of platform. It is also known as (WORA) Write Once Run Anywhere.
Why Java is an Object Oriented Programming language?
Java is an Object Oriented Programming language because without using class concepts we cannot write even a single program in Java. Object-Oriented Programming is faster, and easy to execute, and maintain. It also gives us a clear structure of our program.
Java can run:
- In a browser as an Applet.
- On the desktop as an Application.
- In a server to provide services (database access).
- Embedded in a device.
- Java Standard Edition (J2SE or JSE): Basic tools and libraries to build applications and applets (Standalone applications).
- Java Enterprise Edition (J2EE or JEE): Tools and libraries to create servlets, Java server pages, etc (Web application).
- Java Micro Edition (J2ME or JME): Libraries to create applications to run on hand-held devices such as PDAs and cellular phones (device programs and mobile applications).
- JDK stands for Java Development Kit and it includes development tools such as the Java compiler, Javadoc, Jar, and debugger.
- JRE stands for Java Runtime Environment and it contains the part of Java libraries required to run Java programs and is intended for end users.
- JVM stands for Java Virtual Machine. It is an abstract machine that provides a runtime environment in which Java bytecode can be executed.
- A programming language such as C/C++ has 1 step execution.
- Java Programming has two-step execution.
How to write a program in Java?
class Student
{
//block of code
}
class Teacher
{
//block of code
}
class Hello
{
public static void main(String[] args) //main method
{
System.out.println("Hello World");
}
}
After compilation, there will be three class files:-
- - Student.class
- - Teacher.class
- - Hello.class
- To compile a java code type - javac Filename, java
- To execute the code type- java Filename
No comments:
Post a Comment