0% found this document useful (0 votes)
5 views11 pages

Java Programming Fundamentals Guide

The document provides an overview of Java basics, including syntax, data types, variables, operators, and expressions. It emphasizes the importance of understanding these foundational concepts for programming in Java. The next topic to be covered is control structures in Java.

Uploaded by

khan.md.usaidali
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)
5 views11 pages

Java Programming Fundamentals Guide

The document provides an overview of Java basics, including syntax, data types, variables, operators, and expressions. It emphasizes the importance of understanding these foundational concepts for programming in Java. The next topic to be covered is control structures in Java.

Uploaded by

khan.md.usaidali
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 Basics

• Unit I – Java Basics and Programming


Fundamentals
• Presented by: Govind Singh Panwar
Objectives
• Learn Java syntax and structure
• Understand data types and variable
declarations
• Use operators and expressions in Java
Java Syntax Overview
• Case-sensitive language
• Code blocks use curly braces {}
• Every statement ends with a semicolon ;
• Class and method structure
Basic Program Structure
public class HelloWorld {
public static void main(String[] args) {
[Link]("Hello, world!");
}
}
• Entry point: main() method
• Print output using [Link]()
Data Types in Java
• Primitive: int, float, double, char, boolean,
byte, short, long
• Non-primitive: Strings, Arrays, Classes,
Interfaces
• Example: int age = 25;
Variables in Java
• Declaring and initializing variables
• Naming conventions
• Scope: local, instance, static
Type Conversion
• Implicit type casting (widening)
• Explicit type casting (narrowing)
• int i = 10;
• double d = i; // widening
• int x = (int) d; // narrowing
Operators in Java
• Arithmetic: +, -, *, /, %
• Relational: ==, !=, <, >, <=, >=
• Logical: &&, ||, !
• Assignment: =, +=, -=, *=
Expressions
• Expressions combine variables, operators, and
values
• int a = 10, b = 20;
• int sum = a + b;
• Evaluation order matters (precedence and
associativity)
Summary
• Java has strict syntax and strong typing
• Understanding data types, variables, and
operators is foundational
• Next: Control Structures in Java
Quick Questions
• What are primitive and non-primitive data
types?
• What is the difference between widening and
narrowing conversions?
• Write a sample Java expression using
arithmetic operators

You might also like