Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
4 views

Java Programming Exam Notes

The document provides exam notes on Java programming, covering key concepts such as Java features, basic program structure, data types, string management, inheritance, methods, control structures, and GUI development using AWT. It explains the differences between compiling and running a program, as well as between primitive and reference types. Additionally, it discusses client-server concepts and the HTTP protocol for web data transfer.

Uploaded by

Aditya Kumar
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)
4 views

Java Programming Exam Notes

The document provides exam notes on Java programming, covering key concepts such as Java features, basic program structure, data types, string management, inheritance, methods, control structures, and GUI development using AWT. It explains the differences between compiling and running a program, as well as between primitive and reference types. Additionally, it discusses client-server concepts and the HTTP protocol for web data transfer.

Uploaded by

Aditya Kumar
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
You are on page 1/ 3

Java Programming - Exam Notes

UNIT-I: Introduction to Java Programming

1. What is Java? Explain its features.

Java is a high-level, object-oriented programming language. Features: Platform-independent, Secure, Robust,

Multi-threaded, Portable.

2. How do you write a basic Java program?

class HelloWorld {

public static void main(String[] args) {

System.out.println("Hello, World!");

3. Difference between compiling and running a Java program:

- Compiling: Converts source code to bytecode using javac.

- Running: Uses java to run bytecode on the JVM.

UNIT-II: Data Types and Strings

1. Java primitive types: byte, short, int, long, float, double, char, boolean.

2. Difference between primitive and reference types:

- Primitive stores values.

- Reference stores addresses of objects.


Java Programming - Exam Notes

3. String vs new String():

- "Java" uses string pool.

- new String("Java") creates a new object.

4. String memory management:

Java uses a String Pool in heap memory for unique literals.

UNIT-III: Classes, Methods, and Control Structures

1. What is Inheritance?

Inheritance allows a class to inherit properties and methods from another class.

2. Declaring and invoking methods:

public int add(int a, int b) { return a + b; }

int result = add(10, 20);

3. Loop types:

- For loop: for(int i=0; i<5; i++)

- While loop: while(i < 5)

- Do-while: do { } while(i < 5);

4. Control statements:

- if, if-else, switch, break, continue, return

UNIT-IV: GUI and Client/Server Concepts


Java Programming - Exam Notes

1. What is AWT?

Java's API for GUI development.

2. GUI with AWT example:

Frame, Button, setBounds, setSize, setLayout, setVisible.

3. Client-side vs Server-side scripting:

- Client: JavaScript

- Server: Servlets, ASP

4. What is HTTP?

HTTP is a protocol for data transfer on the web using request-response.

You might also like