0% found this document useful (0 votes)
11 views2 pages

Java Day1 Notes

The document provides an overview of Java programming, highlighting its key features such as platform independence and object-oriented design. It covers the basic structure of a Java program, data types, variable declaration and initialization, and various operators. Additionally, it includes practice tasks for learners to apply their knowledge.

Uploaded by

soumyajoshi675
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)
11 views2 pages

Java Day1 Notes

The document provides an overview of Java programming, highlighting its key features such as platform independence and object-oriented design. It covers the basic structure of a Java program, data types, variable declaration and initialization, and various operators. Additionally, it includes practice tasks for learners to apply their knowledge.

Uploaded by

soumyajoshi675
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

Java Programming - Day 1 Notes

1. Java Overview

Java is a high-level, object-oriented programming language.

Key Features:

- Platform Independent (Write Once, Run Anywhere)

- Object-Oriented, Secure, Robust

- Multithreading support

- Rich standard and third-party libraries

2. Java Program Structure

Example:

public class HelloWorld {

public static void main(String[] args) {

[Link]("Hello, World!");

3. Java Data Types

Primitive Types:

- int: 1, 200, -34

- float: 3.14f

- double: 3.14159

- char: 'A'

- boolean: true, false

Non-Primitive:

- String: "Hello" (class)

Example:

int a = 10;
Java Programming - Day 1 Notes

float b = 5.5f;

char grade = 'A';

boolean passed = true;

String name = "Soumya";

4. Variables

Declaration: int x;

Initialization: x = 10;

Combined: int x = 10;

Naming convention: camelCase (e.g., studentName)

5. Operators

Arithmetic:

int a = 10, b = 3;

a + b, a - b, a * b, a / b, a % b

Relational: >, <, ==, !=

Logical: &&, ||, !

Assignment: x += 3, x++, x--

Practice Tasks

1. Write a program to display your name and age.

2. Declare and print all variable types.

3. Try all operators and print the results.

You might also like