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

Java Basics Notes

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)
1 views1 page

Java Basics Notes

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 Notes

What is Java?
Java is a platform-independent, object-oriented programming language. Code is compiled to
bytecode and runs on the JVM.

JDK, JRE, JVM


JDK: Development tools + JRE. JRE: JVM + libraries. JVM executes bytecode.

Program Structure
class, main() method, statements, comments.

Variables
Primitive: byte, short, int, long, float, double, char, boolean. Non-primitive: String, Arrays, Classes.

Operators
Arithmetic, Relational, Logical, Assignment, Unary, Ternary.

Control Statements
if, if-else, switch, for, while, do-while, break, continue.

Methods
Syntax, parameters, return type, method overloading.

Arrays
Single and multidimensional arrays, traversal with loops.

Strings
String creation, common methods: length(), charAt(), substring(), equals(), toUpperCase().

OOP Intro
Class, Object, Constructor, Encapsulation, Inheritance, Polymorphism, Abstraction.

Exception Basics
try, catch, finally, throw, throws.

Important Tips
Java is case-sensitive. One public class per file. main(): public static void main(String[] args).

You might also like