Yes, we can. In order to compile a java program, we don't require any main method. But to execute a java program we must have a main in it (unless it is an applet or servlet). Because main is the starting point of a java program.
Which of these class have only one field 'TYPE' ?
The Void class has one field, TYPE, which holds a reference to the Class object for the type void.
What is the string contained in s after following lines of code?
StringBuffer s = new StringBuffer(“Hello”); s.deleteCharAt(0); ?
deleteCharAt() method deletes the character at the specified index location and returns the resulting StringBuffer object.
So after deleting the character at 0 ie 'H', the string returns 'ello' as the output.
Which of the following are incorrect form of StringBuffer class constructor ?
Does not overriding hashcode() method has any performance implication ?
A poor Hashcode() function will result in frequent collision in HashMap which eventually increase time for adding an object into Hash Map.
How do you handle error condition while writing stored procedure or accessing stored procedure from java ?
Stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only choice.
We'll send you weekly updates from Sawaal
Copyright © 2016 Sawaal.com | All Rights Reserved