In java when a field is declared and not initialized,java compiler will be set the default value to the field value based on datatype of the field.Here are the list of datatypes and default values. Continue reading
Sometimes in real world a situation may arise where we can supply inputs to the application at the time of program execution.This can be done with help of command line arguments in java.
commandline arguments are the parameters that are supplied to the program at the time of execution. Continue reading
Here are some of the important features in java which are removed from c/c++ :
1) Pointers :
C++ supports pointer but java does not supports pointers.
2) Templates :
c++ supports templates but java does not supports templates. Continue reading
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space :
Problem : Whenver i run the application with tomcat server iam gettting the following exception. Continue reading
org.hibernate.MappingException: Repeated column in mapping for entity:
Explain final class variables with example in java?
1) We can declare class variable with final keyword.
2) Final class variables can be initialized in two ways:
1) At the time of declaration
2) Static Initializers Continue reading
1) Formal paramters can be declared as final .
2) A formal parameter is initialized automatically with the value of the actual parameter when the method or the constructor is invoked.
3) Therefore final formal parameter value cannot be changed inside the method’s or the constructor’s body. Continue reading
Final Local variables:
1) Declaring local variables with final keyword are called as final local variables.
2) Values can be assigned to final local variable once.
3) Attempting to modify the final local variables after they are assigned results in compilation error. 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)