RMS Java Revision
RMS Java Revision
1. Data Types :
Primitive :- 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) Arithmetic :-
1) +
2) -
3) *
4) /
5) %
6) ++
7) --
2) Assignment :-
1) =
3) Comparison :-
1) >
2) <
3) >=
4) <=
5) ==
6) !=
4) logical :-
&&(both condition true)
||(at least One condition 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
Programming questions :-
1. String reverse
==================================================================================
==================================================================================
4. Typecasting :
converting one data type to another.
1) Widening(automatically) (implicit) :-
convert smaller to larger
2) nested if else :-
3) switch :-
==================================================================================
==================================================================================
6. Loops :
1) for loop :-
4) while loop :-
5) do while loop :-
Syntax :
Limitations :-
Size is fixed
Cannot delete or add value
Types :-
Single Dimensional Array
2 D array
Programming Questions :-
1) Find out Second max and second min number from array .
2) Count of words
3) Separate 0's and 1's
==================================================================================
==================================================================================
8. Methods :
1) static method
Syntax :
4) parametrized method
Syntax :
==================================================================================
==================================================================================
9. OOPS concepts :
1) Inheritance :-
Definition –
purpose –
Types –
1) Single
2) Multilevel
3) Hierarchical
4) Multiple Hybrid
2) Polymorphissm :-
Definition –
purpose –
Types –
same method name with same parameters and we should achieve through inheritance.
3) Abstraction :-
Definition – Hide sensitive data and show only essential information
purpose –
Types – To Achieve the abstraction 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 partial abstraction here 4. You can achieve 100 % abstraction here
4) Encapsulation :-
Definition – Wrapping data into a single unit
Advantages –
1.hide the data
2. control the class read or write
2. Use public getter and setter method to access and update the value of private variable.
==================================================================================
==================================================================================
10. Modifiers :
I) Access modifiers –
Class - public , default
Method, Variables, Constructors - public , private , default , protected.
==================================================================================
==================================================================================
11. Exception handling :
==================================================================================
==================================================================================
12. Collections :
4. programming questions-
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. Implementations –
==================================================================================
==================================================================================
13. Constructor :
rules –
Types –
1. Zero-Argument
2. Parameterized
3. Default
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
==================================================================================
JVM --- Java virtual machine --To verify the byte code ---
==================================================================================
==================================================================================