JAVA – SHORT NOTES FOR CLASS 8 (ICSE)
Introduction to Java**
Java is a *high-level, object-oriented programming language* used to create applications for
computers, mobile phones, and the internet. It follows the rule “Write Once, Run Anywhere”
(WORA)**.
History of Java (In Brief)
Developed by: James Gosling and his team at *Sun Microsystems*.
Year Developed: 1991 (Project name: Oak)
Renamed as Java: 1995
Owned by Oracle: After Oracle bought Sun Microsystems in 2010, Java became an Oracle
product.
* Java was originally made for small electronic devices but later became widely used for
web and mobile applications.
Features of Java:
Simple: Easy to learn and use.
Object-Oriented: Uses concepts like classes, objects, and methods.
Platform-Independent: Runs on any computer because of the **Java Virtual Machine
(JVM)**.
Secure: Protects data and programs from unauthorized access.
Robust: Has strong memory management and error handling.
Portable: Java programs can run anywhere without changes.
Uses of Java --
Java is used in many --fields, such as:
Mobile Applications: Especially **Android apps**.
Web Applications: Websites, online shopping, banking
systems.
Desktop Software: Games and utility software.
Servers: * Handling internet services and databases.
Smart Devices: TVs, smart cards, ATMs, Blu-ray players.
Scientific Applications : Research tools and simulations.
Why Java Is Popular**?
Runs on all types of devices.
Has a huge community of developers.
Stable, reliable, and secure.
Used by companies worldwide for major projects.
Working Model---
Java Programming language format :-
DESCRIPTION
like,
class Hello {
public static void main(String[] args) {
[Link]("Hello, World!");
}
}
1. `class Hello {
`class` is a keyword used to declare a *class*.
`Hello` is the *name* of the class.
`{` indicates the *start of the class block*.
2. `public static void main(String[] args) {
This is the *main method*. Every Java program must have it because the program **starts
running from here.
public* – The method can be used by the Java system from anywhere.
static* – It can run without creating an object of the class.
void* – It does not return any value.
main* – The name of the method where execution begins.
String[] args* – It can take input from the command line (not needed for now, but
required in the structure).
`{` – Start of the main method.
3. `[Link]("Hello, World!");
This line *prints text* on the screen.
`[Link]()` is a built-in Java command used for **displaying output**.
`"Hello, World!"` is the message it will print.
`;` ends the statement.
4. `}` (closing braces)
The first `}` closes the *main method*.
The second `}` closes the *class*.
**Summary (Very Short Notes)**
A Java program has a *class*
Inside the class, there is a *main method*.
The *main method* is where the program starts running.
`[Link]()` is used to *print output*.