Java Roadmap
Java – Intro
Java – Statements, commands
Java – identifier and rules, keywords
Java – Data types
Java – operators
Java – Control flow statement {control & iterative}
Java – Access modifier
Java – OOPs
Java – Exception Handling
Java – package, lang package
Java – collection framework
Java – 8 features => Functional interface, lambda expression/
single arrow, predefined FI=> function, predicate, consumer,
supplier, Bi function, Bi predicate, double colon operator
Interface & enhancement => static, default method
Date & time API
Stream API
Optional Class
Spring Boot
Java
Java is a high-level language and object-oriented programming language.
Java is Strictly Typed Programming language.
It is designed to be simple, secure, portable, and platform-independent,
meaning you can write code once and run it anywhere
What is different between Compiler and Interpreter?
A compiler translates the entire source code of a program into machine
code (or bytecode) before execution. (Java, C++, .Net)
An interpreter translates and executes the code line by line, at runtime
(while the program is running).(Python, JavaScript)
Java file contain
Classes variable + methods
Interface variable + methods
Enum
Identifier:
A name in java program is called identifier. It can be either class name,
variable name, method, label name
If we are using any other characters we will get compile time error.
Identifier Rules:
Identifier should contain a-z, A-Z, 0 to 9, _, $.
Identifier should not start with digits 0 to 9
Identifier should not contain any special symbol/character.
Identifier should not use keyword/Reserved words
Identifier are case Sensitive.
Keywords: In Java there are 50+ keywords are there.
Data Types true, false, byte, short, int, long, float, double, char
Operators instance of, new
Control flow if, else, switch, case, break, default, for, while, do
Access Modifier public, static, native, specifier, private, final, protected,
synchronized
OOP class, extends, import, new, super, implements, export
Error handling try, catch, finally, throw,
Java Comments:
Comments in java are non-executable code. It is meant only for humans to
read.
Single line Comments //
Multi line comments /* ……. */
Java Data Type:
Java is Strictly Typed Programming Language. There are 3 Data Types
Pre-defined / primitive Data Types
Derived Data Types
User Defined Data Types
Primitive Data Types:
It can hold single values.
Numeric Data Types * Integral – bytes(range: -128 to 127),
short(range: -32768 to 32767), int(range: 2 power 31), long
* Floating – float, double.
Char Data Types Char
Boolean Data Types Boolean
Example:
Derived/ Reference Data Type:
Reference/Derived data type are holds multiple values.
String
Array
Java Array:
Array is group of elements as one entity
It allowed duplicates.
Array don’t allow heterogeneous elements
Array element are storing based on indexing.
Example:
Java Variable:
A variable in Java is like a container that holds data. You give it a name,
and you can store different values in it while the program runs.
Types of Variable;
Instance Variable default values are stored based on type, in case only
declaration.
Static Variable default values are stored based on type, in case only
declaration.
Local Variable
Instance Variable:
if variable value is varied from object to object.
Separate copy will create for object to object.
Where to use inside a class, out the method()
How to access using object/ instance only
Example:
Static Variable:
If variable value is not varied from object to object
Only one copy will create at class level & shared every object, using
Instance/ object & using className.
Where to use inside a class, outside methods using static keywords
How to access using object and using ClassName or using directly
in static context methods.
Example:
Local Variable:
Local variable scope is with in the method only
Local variables disappear once the method or block ends.
Example:
Local Variables:
For temporary purpose
How to create : within the method
Scope of the local variable is within the method
There is no default value for local variable.
Before using local variable it requires initialization.
Arrays in java:
How to read array: using indexing you can access array.
Creating array,initialization and inserting values.