0% found this document useful (0 votes)
12 views1 page

? Page 2

The document outlines Java data types, categorizing them into primitive types (e.g., int, float, boolean) and non-primitive types (e.g., String, Arrays). It explains variable declaration, initialization, and type casting, including implicit and explicit casting. Additionally, it lists various operators used in Java, including arithmetic, relational, logical, and assignment operators.

Uploaded by

online school
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

? Page 2

The document outlines Java data types, categorizing them into primitive types (e.g., int, float, boolean) and non-primitive types (e.g., String, Arrays). It explains variable declaration, initialization, and type casting, including implicit and explicit casting. Additionally, it lists various operators used in Java, including arithmetic, relational, logical, and assignment operators.

Uploaded by

online school
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

📄 Page 2: Variables, Data Types & Operators

Java Data Types

 Primitive Types:
int, byte, short, long, float, double, char, boolean
 Non-Primitive Types:
String, Arrays, Objects

Variables

 Declaration: int age;


 Initialization: age = 25;
 Combined: int age = 25;

Type Casting

 Implicit (smaller to larger): int → long


 Explicit (larger to smaller): double d = (int) 5.6;

Operators

 Arithmetic: +, -, *, /, %
 Relational: ==, !=, >, <, >=, <=
 Logical: &&, ||, !
 Assignment: =, +=, -=, etc.

You might also like