-
Hajipur, Bihar, 844101
Java is a high-level, class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. It was developed by James Gosling at Sun Microsystems and released in 1995.
Java programs are compiled into bytecode and run on the Java Virtual Machine (JVM), making them platform-independent.
Write once, run anywhere (WORA) — platform-independent
Object-Oriented Programming (OOP) support
Large standard library
Used in Android development, web apps, enterprise software, etc.
Strong memory management and security features
Platform Independent
Object-Oriented
Simple and Secure
High Performance
Multithreaded
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
class Main
— defines the class
main()
— entry point of Java programs
System.out.println()
— prints output
Write the code in a file named Main.java
Compile using:
javac Main.java
java Main
Q1. Print "Hello Java"
Q2. Add two integers
Q3. Use single-line comment
Q4. Take user input using Scanner
Q5. Multiply two floating-point numbers
Q1: Who invented Java?
Q2: What is the correct file extension for Java files?
Q3: Which method is the entry point of a Java program?
Q4: What does JVM stand for?
Q5: What will System.out.println("Hello"); output?