0% found this document useful (0 votes)
2 views5 pages

Introduction To Java

The document provides an introduction to Java, a general-purpose, object-oriented programming language developed by Sun Microsystems in 1995. It outlines Java's features, uses, and components, including the Java Development Kit (JDK), Java Runtime Environment (JRE), and Java Virtual Machine (JVM). Additionally, it explains the basic syntax and steps to create, compile, and run a simple Java program.

Uploaded by

gauri.s9374
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

Introduction To Java

The document provides an introduction to Java, a general-purpose, object-oriented programming language developed by Sun Microsystems in 1995. It outlines Java's features, uses, and components, including the Java Development Kit (JDK), Java Runtime Environment (JRE), and Java Virtual Machine (JVM). Additionally, it explains the basic syntax and steps to create, compile, and run a simple Java program.

Uploaded by

gauri.s9374
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MAHARANA PRATAP SENIOR SECONDARY SCHOOL

SUBJECT- COMPUTER
CLASS – XII
e-notes by-
SAURABH CHAUDHARY

Lesson [Link] to Java

What is Java?
Java is a general-purpose, class-based, object-oriented programming language
.It is a computing platform for application development. Java is fast, secure, and
reliable, therefore. It is widely used for❮ P

 Mobile applications (specially Android apps)


 Desktop applications
 Web applications
 Web servers and application servers
 Games
 Database connection

Java is and open source language which means that anyone can use it for free it
is an object oriented language which means that program are written using
classes and object Java is a platform independent language which means that the
code written in Java can be run on any computer and operating system

History of Java
1. Java was developed by Sun Microsystems in 1995.
2. Originally, it was developed for handling portable devices and set-top
boxes.
3. James Gosling is known as the father of Java.
4. Before Java, its name was Oak. Since Oak was already a registered
company, so James Gosling and his team changed the name from Oak to
Java.
5. Later, in 2009, Oracle Corporation acquired Sun Microsystems and took
ownership of Java.
Features of Java
1. Simple - It is one of the easy-to-use programming languages to learn.
2. Portable - Java is portable because it facilitates you to carry the Java byte code to
any platform. It doesn't require any implementation. Write code once and run
anywhere (WORA) on computing platform.
3. Platform-Independent - Java is platform-independent. Some programs
developed in one machine can be executed in another machine.
4. Object-Oriented - It is designed for building object-oriented
applications.
5. Multithreading - It is a multithreaded language with automatic memory
management.
6. Distributed - It is created for the distributed environment of the Internet.

Uses of Java
 It is used for developing Android Apps
 Helps you to create Enterprise Software
 Wide range of Mobile java Applications
 Scientific Computing Applications
 Use for Big Data Analytics
 Java Programming of Hardware devices
 Used for Server-Side Technologies like Apache

Components of Java
1. JDK - JDK stands for Java development kit. It internally contains JRE
and JVM where JRE stands for Java Runtime Environment and JVM
stands for Java Virtual [Link] provide all the tools to work with
Java Language.

2. JRE - JRE stands for Java Runtime Environment, its provide an


environment to execute the Java program it internally contains JVM
which is responsible to execute Java programs.

3. JVM - JVM stands for Java Virtual Machine, it is the software in the
form of interpreter written in ‘c’ language through which we can execute
our Java programs.
Working of Java Program

First Java Program


Steps to Implement Java Program
Implementation of a Java application program involves the following
step. They include:
1. Creating the program
2. Compiling the program
3. Running the program

1. Creating the program

public class MyFirstJavaProgram {

/* This is my first java program.


* This will print 'Hello World' as the output
*/

public static void main(String []args) {


[Link]("Hello World"); // prints
Hello World
}
}
Let's look at how to save the file, compile, and run the program. Please follow
the subsequent steps −

 Open notepad and add the code as above.


 Save the file as: [Link].
 Open a command prompt window and go to the directory where you
saved the class. Assume it's C:\.
 Type 'javac [Link]' and press enter to compile your
code. If there are no errors in your code, the command prompt will take
you to the next line (Assumption : The path variable is set).
 Now, type ' java MyFirstJavaProgram ' to run your program.
 You will be able to see ' Hello World ' printed on the window.

2. Compiling the program

C:\> javac [Link]

3. running the program

C:\> java MyFirstJavaProgram

Output

Hello World

Basic Syntax
About Java programs, it is very important to keep in mind the following points.

 Case Sensitivity − Java is case sensitive, which means


identifier Hello and hello would have different meaning in Java.
 Class Names − For all class names the first letter should be in Upper
Case. If several words are used to form a name of the class, each inner
word's first letter should be in Upper Case.
Example: class MyFirstJavaClass
 Method Names − All method names should start with a Lower Case
letter. If several words are used to form the name of the method, then
each inner word's first letter should be in Upper Case.
Example: public void myMethodName()
 Program File Name − Name of the program file should exactly match
the class name.
When saving the file, you should save it using the class name (Remember
Java is case sensitive) and append '.java' to the end of the name (if the file
name and the class name do not match, your program will not compile).
But please make a note that in case you do not have a public class present
in the file then file name can be different than class name. It is also not
mandatory to have a public class in the file.
Example: Assume 'MyFirstJavaProgram' is the class name. Then the file
should be saved as '[Link]'
 public static void main(String args[]) − Java program processing starts
from the main() method which is a mandatory part of every Java
program.

You might also like