Java Demo
Java Demo
What is Java
• Java is a programming language and a platform. Java is a high level, robust, object-oriented and secure programming language.
• Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in the year 1995. James Gosling is known as the
father of Java.
JAVA Application
• Games, etc .
Types of Java Applications
• There are mainly 4 types of applications that can be created using Java programming:
• 1) Standalone Application
• Standalone applications are also known as desktop applications or window-based applications. These are
traditional software that we need to install on every machine. Examples of standalone application are Media
player, antivirus, etc. AWT and Swing are used in Java for creating standalone applications.
• 2) Web Application
• An application that runs on the server side and creates a dynamic page is called a web application. Currently,
Servlet, JSP, Struts, Spring, Hibernate, JSF, etc. technologies are used for creating web applications in Java.
• 3) Enterprise Application
• An application that is distributed in nature, such as banking applications, etc. is called enterprise application. It
has advantages of the high-level security, load balancing, and clustering. In Java, EJB is used for creating
enterprise applications.
JAVA Applications
• 4) Mobile Application
• An application which is created for mobile devices is called a mobile application. Currently, Android and Java ME
are used for creating mobile applications.
Java Platforms / Editions
Mainly used for C++ is mainly used for system Java is mainly used for
programming. application programming. It is
widely used in window, web-
based, enterprise and mobile
applications.
Design Goal C++ was designed for systems Java was designed and created
and applications programming. It as an interpreter for printing
was an extension of systems but later extended as a
C programming language. support network computing. It
was designed with a goal of
being easy to use and accessible
to a broader audience.
C++ vs Java
Goto C++ supports the goto statement. Java doesn't support the goto
statement.
Multiple inheritance C++ supports multiple Java doesn't support multiple
inheritance. inheritance through class. It can
be achieved by interfaces in java.
Call by Value and Call by C++ supports both call by value Java supports call by value only.
reference and call by reference. There is no call by reference in
java.
Java Hello World Example
• For executing any java program, you need to Install the JDK.
• Set path of the jdk/bin directory.
• Create the java program
• Compile and run the java program
class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
Java Program Compilation-