JAVArevision
JAVArevision
1. Data Types :
Primi ve :- Size is already defined in java
1) byte
2) short
3) int
4) long
5) float
6) double
7) Boolean
8) char
==================================================================================
==================================================================================
2. Operators :
1) Arithme c :-
1) +
2) -
3) *
4) /
5) %
6) ++
7) --
2) Assignment :-
1) =
3) Comparison :-
1) >
2) <
3) >=
4) <=
5) ==
6) !=
4) logical :-
&&(both condi on true)
||(at least One condi on should be true )
! (reverse the result)
==================================================================================
==================================================================================
3. String methods :
1) Length
2) charAt
3) toUpprcase
4) toLowercase
5) concat
6) contains
7) substring
8) equals
9) equalsignorecase
10) replace
11) replaceAll
12) trim
13) split
1. String reverse
==================================================================================
==================================================================================
4. Typecas ng :
conver ng one data type to another.
==================================================================================
==================================================================================
5. Condi on blocks :
1) if else :-
2) nested if else :-
3) switch :-
==================================================================================
==================================================================================
6. Loops :
1) for loop :-
4) while loop :-
5) do while loop :-
==================================================================================
==================================================================================
7. Arrays :
To store mul ple values in a single variable of same datatype.
Syntax :
Limita ons :-
Size is fixed
Cannot delete or add value
Types :-
Single Dimensional Array
2 D array
==================================================================================
==================================================================================
8. Methods :
1) sta c method
Syntax :
4) parametrized method
Syntax :
==================================================================================
==================================================================================
9. OOPS concepts :
1) Inheritance :-
Defini on –
purpose –
Types –
1) Single
2) Mul level
3) Hierarchical
2) Polymorphissm :-
Defini on –
purpose –
Types –
same method name with same parameters and we should achieve through inheritance.
3) Abstrac on :-
Defini on – Hide sensi ve data and show only essen al informa on
purpose –
Types – To Achieve the abstrac on we have two ways
I) Abstract class
II) interface
2. We can’t create object of interface, use the implements class to create objects
3. interface methods do not have body, write inside the implements class .
1. We can have regular and abstract methods 1. By default all the methods are abstract ‘
‘ methods
4.you can achieve par al abstrac on here 4. You can achieve 100 % abstrac on here
4) Encapsula on :-
Defini on – Wrapping data into a single unit
Advantages –
1.hide the data
2. control the class read or write
2. Use public ge er and se er method to access and update the value of private variable.
// ge er --access --get
==================================================================================
==================================================================================
10. Modifiers :
I) Access modifiers –
Class - public , default
Method, Variables, Constructors - public , private , default , protected.
==================================================================================
==================================================================================
11. Excep on handling :
==================================================================================
==================================================================================
12. Collec ons :
a) Remove duplicates
b) Occurrence of each character using HashMap
c) first related
d) last repeated
e) first non-repeated
f) last non -repeated
g) Print duplicates
5. Implementa ons –
==================================================================================
==================================================================================
13. Constructor :
rules –
Types –
1. Zero-Argument
2. Parameterized
3. Default
==================================================================================
==================================================================================
==================================================================================
==================================================================================
15. Final and finally difference :
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
18. String , string buffer and string builder --
==================================================================================
==================================================================================
JVM --- Java virtual machine --To verify the byte code ---
==================================================================================
==================================================================================