0% found this document useful (0 votes)
2 views

javabasic

Java is a high-level, object-oriented programming language developed by Sun Microsystems in 1995, now owned by Oracle, and is platform-independent due to its bytecode running on any platform with a JVM. A Java program must include at least one class and the main method serves as the entry point for execution. The document also covers basic syntax, including variable declarations and primitive data types.

Uploaded by

l31534419
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

javabasic

Java is a high-level, object-oriented programming language developed by Sun Microsystems in 1995, now owned by Oracle, and is platform-independent due to its bytecode running on any platform with a JVM. A Java program must include at least one class and the main method serves as the entry point for execution. The document also covers basic syntax, including variable declarations and primitive data types.

Uploaded by

l31534419
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Java Class Notes

1. Introduction to Java
What is Java?
Java is a high-level, object-oriented programming language developed by Sun
Microsystems in 1995, now owned by Oracle.
Platform-independent: Java code is compiled into bytecode, which can run on any
platform with a Java Virtual Machine (JVM).
JVM (Java Virtual Machine):
Responsible for running Java programs and converting bytecode into machine code
specific to the platform.
2. Basic Syntax and Structure
Java Program Structure:
java
Copy
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Class Declaration: Every Java program must have at least one class.
Main Method: Entry point of a Java application. The main method is where the
execution starts.
Statements and Expressions: Java uses statements to perform actions (e.g.,
System.out.println()).
Comments:
Single-line: // This is a comment
Multi-line: /* This is a multi-line comment */
3. Variables and Data Types
Primitive Data Types:
int: Integer values.
double: Floating-point values.
char: Single characters.
boolean: True or false.
byte, short, long, float: Other numerical types with varying ranges.
Declaration:
java
Copy
int num = 10;
double price = 20.99;
char grade = 'A';
boolean isJavaFun = true;

You might also like