37) Collections :
Collections class contains several static methods and constants which are useful for working with collections.Collections defines several algorithms which can be applied to collection objects.
Collections contains several static methods. Continue reading
31) ClassLoaders :
Class loaders in java are used to load classes at runtime.
There are 3 different class loaders in java :
- Bootstrap class loader
- Extension class loader
- System class loader.
32) Class method :
Class methods are also called as static methods.
Static members are used by other classes without creating an instance of the class.
Static methods do not operate on objects.
Methods are declared as static when they perform operations independent of instance variables.
Static method belongs to whole class not to particular instance.
Static method operate only on static data and cannot access non static data such as instance variables.
A static method can call other static method but cannot call non static methods.
A static method cannot refer to super or this keyword.
Example : Math class which contains only static fields and methods.
To call static method use class name followed by dot.
Note : JDK 8 added a new feature static methods can be defined in interface.Just like how we call static methods in class in the same way we call static methods in interface. Continue reading
26) Cast :
Casting is used to convert one datatype in to another.We can use casting to convert double to int.In casting there is a chance to lose information.
For example : when converting double to int.
27) Catch :
Catch block is used to catch the exception.Catch block gets executed whenever an exception is thrown.Each catch block is an exception handler that handles the exception indicated by its argument.
Prior to java 7 catch block can handle only type of exception.From Java 7 a catch block can handle more than one type of exception.
Catch blocks are associated with try blocks.For every try block there should be atleast one catch block or finally block. Continue reading
21) boolean :
boolean is one of the primitive datatype in java that contains either true or false value.
Ex : boolean b=true;
Boolean is an wrapper class which wraps a value of primitive type in to Object.Boolean class has many methods to convert Boolean value to Strings and other methods for dealing boolean value.
23) Bootstrap class loader :
This class loader loads java core classes such as java.lang,java.util.It loads the classes from JRE/lib/rt.jar.
A break statement transfers the control .break statement has the following uses:
- It terminates the statement in Switch Statement.
- It is used to exit loop.When a break statement is used inner loop it only terminates inner loop,outer loop remains unaffected.
binarySearch() method is used to search for a specified value.This method is applied for sortedArrays.
static int binarySearch(byte array[ ], byte value)
static int binarySearch(char array[ ], char value)
16) Arithmetic operators:
Arithmetic operators are used to perform arithmetic operations
like addition,subtraction etc.Arithmetic operators are called binary operator because it acts on two operands at a time.
Here are the list of arithmetic operators in java:
11) ArrayList :
Arraylist is similar to array but arraylists are dynamic in nature except arraylist objects grow and shrink as needed.Arraylist is an resizable array.Adding and deleting elements in array should be manually.Developer has to implement logic to add and delete elements.
Using arraylist adding and removing elements is made easier with help of add() and remove() methods. Continue reading
Annotations are meta tags.Annotations allows us to add metadata to classes,methods,fields,packages.Annotations are not part of the code and annotation dont directly impact our code. These meta data can be used by java tools both at compile time at run time.
Annotations have the following uses :
- Information for the compiler : Annotations provide information to the compiler to detect errors or surpress warnings.
- Compiletime and runtime processing : Annotations provide information to the software tools to generate code,xml files and so forth.
Here are some of the predefined or built in annotations :
We can create our annotations. Annotations are declared with @. Continue reading
abstract is an modifier used for a method or class.
2) Abstract method:
abstract modifier declared infront of a method declaration is called abstract method. Continue reading