What exactly is the difference between between throw and throws? If both are used for the same purpose then why are both needed instead of one?
Latest Answer: hi there, throw:the throw keyword is used to throw the exception manually,that is when you feel a particular line in your code, when executed is capable of having some exception ...
What will happen if same access specifier repeats more than once within a class?
Latest Answer: Multiple Acceess Specifier cannot be used with a class because it makes no sense and if you do so compile time error(wrong combination of modifiers) will be generated. ...
When We should use Synchronization in Java and when we should not?
Latest Answer: Synchronization is used in Java, if there are multiple threads which are accessing same variable, then they access it one by one. ...
suppose i have 2 members in my class can i serialize a single member? Is there any way to do that?
Latest Answer: how about move the other 24 member variable to a class?... ...
What is Use of declaring an array list object like List list = new ArrayList() rather than creating object like ArrayList arr = new ArrayList();
Latest Answer: We may decide later to use the LinkedList instead of ArrayList, in this situation we just need to replace the new ArrayList() part with new LinkedList() if we keep the referance variable as List interface.whereas if we keep ArrayList as the referance ...
We usually extend Exception instead of Throwable. Why? In what situations we extend Throwable.Could anybody give the answer in detail. Thanks in advance.
Latest Answer: By extending Throwable, you are giving hook for RuntimeException and programmers normally do not catch unchecked exceptions. However, if you have an app server and want to ensure that the server is not brought down by some ...
Latest Answer: If the variable 'str' is Stringstr=5.45+"3.2"=5.453.2 ...
Latest Answer: Yes we can declare interface in servlet through httpservlate ...
What is the output of the following program, When tested under JDK 5.0class ExceptionDemo{ public static void main(String[] args) { int a[] = new int[] {1,2,3,4,5}; try{ System.out.prinltln(a[6]);
Latest Answer: It will generate compile time error. Unreachable code. ...
public interface I1{Static String x="inside I1";public void someMethod();}class A implements I1{ public static void main(String args[[]){ System.out.println("Calling I1 var ..."+I1.x);}}
Latest Answer: Compilation error will come because you must have to override the abstract method of the implememted interface. After the implementation of the abstract method the program will compile and run properly and print "inside l1". ...
View page << Previous 1 2 [3] 4 5 6 7 8 9 10 Next >>

Go Top