Vector The underlying data structure is resizable or growable Array. Insertion order is preserve. Duplicate objects are allow. Null insertion is possible. Hetrogenious objects are allow. Vector class implements Serializable, Clonable & RandomAccess interface. Best suitable for frequent operation is retrieval. Worst choice is frequent operation is insertion or deletion on middle. Every method present […]
Collection Framework
Limitations of Object Array:- ⇒ Arrays are fixed in size i.e once we created an array there is no chance of increasing or decreasing the size our requirement i.e if we don’t know the size in advance, arrays are not recommended to use. ⇒ Arrays can hold only homogeneous data elements. Student [] s = […]
Static Import
Static Import This concept is introduces in 1.5, According to static import, improves readability of the code. But According to world wide experts, static import reduces readability and increases the confusion of the code. Hence if there is no specific requirement, it is not recommended to use static import. When we are using static import, […]
Evaluation Order of Java Operand
Evaluation Order of Java Operand Before applying any operator, all the Operands should be evaluated from left to right.
Precedence Of Java Operator
Precedence Of Java Operators Uniary Operators :- [ 1st level [ ], x++, x– ], [ 2nd level ++x, –x, ~, ! ], [ 3rd level new, <type> ]. Arithmetic Operators:- *, /, %, +, – . Shift Operators:- >>, >>>, << . Comparison Operators:- <, <=, >, >=, instance of, == . Bitwise Operators:- […]
New Operator
New Operator New operator can be used for the creation of Object. Note:- There is no delete operator in java, Destruction of useless Objects will take care by Garbage Collector.
Conditional Operator
The only ternary operator available in java is conditional operator. int a = ( 10<20 ) ? 30 : 40 ; System.out.println( a) ; // 30 Nesting of conditional operator is also allowed in java. int x = ( 100>200 ) ? 10 : ( (1000>3000) ? 20 : 30 ) ; System.out.println( x) ; […]
Assignment Operator
Assignments The following is the list of all possible compound assignment operator. + = & = % = – = | = >>> = * = ^ = << = / = >> = In the case of compound assignment operator, the required type casting is performed automatically by the compiler. byte b = 20 […]
Instance Of Operator
Instance Of Operator Syntax:- t instanceof x t ==> Object / Obj reference. x ==> class name / interface Ex:- Thread t = new Thread ( ) ; System.out.println ( t instanceof Thread ) ; // true System.out.println ( t instanceof Object ) ; // true System.out.println ( t instanceof Runnable ) ; // […]
Types Cast Operator
Type Cast Operator There are two types of primitive type castings a possible. implicit type casting explicit type casting Implicit Type Casting Compiler is responsible for this type casting. performed automatically where ever we are assigning smaller value to the bigger data type It is also known as Widening or up casting There is no […]