Java ICSE Class 10 - Lecture Notes
Lecture 1: Introduction to Java & Basics
1. What is Java?
- Java is a high-level, object-oriented programming language.
- Developed by James Gosling at Sun Microsystems (now Oracle).
- Platform-independent using JVM (Write Once, Run Anywhere - WORA).
2. Features of Java:
- Simple, Object-Oriented, Platform-Independent, Secure, Robust, Multithreaded.
3. Comparison with Other Languages:
| Feature | Java | C++ | Python |
|------------------|----------------|---------------|----------------|
| Platform Support | Yes (via JVM) | No | Yes (Interpreter) |
| OOP Support | Fully OOP | Partially OOP | OOP + Scripting |
| Syntax Simplicity| Moderate | Complex | Very simple |
| Compilation | Bytecode | Machine Code | Interpreted |
4. Role of Java in ICSE:
- Builds programming fundamentals, logic, and object-oriented concepts.
5. Applications of Java:
- Android apps, games, web apps, enterprise systems, and more.
Lecture 2: Java Program Structure, Syntax & Output
1. Java Program Structure:
class ClassName {
public static void main(String args[]) {
// code
Java ICSE Class 10 - Lecture Notes
2. Output in Java:
- System.out.println("text"); -> prints with newline
- System.out.print("text"); -> prints without newline
3. Java Syntax Rules:
- Case-sensitive, use semicolons, file name = class name + .java
4. Identifiers vs Keywords:
- Identifiers: user-defined (e.g., age, score)
- Keywords: reserved (e.g., class, int, public)
5. Comments in Java:
- Single-line: // comment
- Multi-line: /* comment */
6. Sample Program:
class Hello {
public static void main(String args[]) {
System.out.println("Welcome to Java!");
7. ICSE Coding Guidelines:
- Use meaningful names, indentation, comments, proper structure.
8. Practice Exercises:
- Print name, message, numbers with print/println, include comments.