-
Overriding Methods
Suppose a Super Class method throws an exception and this method is Overriden in the subclass with no exception. Now if you create a super class reference that has a subclass object. This throws a compile time error, Why?
-
Null keyword
Is null a keyword? if not what is it?
-
difference between throw and throws
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?
-
Output of Java Program
What is the output of the following program?class A{ public static void main(String[] s) { System.out.println(s[1] + s[2] + s[3]);}}java A 12345Options(i) 1(ii) 12(iii)1234(iv)234(v) Compilation Error
-
-
-
What is the result of the following?public static void main(String[] args)
choice:a)compilation errorb)runtime errror Or what is the result?
-
How are this() and super() used with constructors
this() is used to invoke a constructor of the same class. super() is used to invoke asuperclass constructor.
-
What is the argument type of a program's main() method
A program's main() method takes an argument of the String[] type.
-
What is the catch or declare rule for method declarations
If a checked exception may be thrown within the body of a method, the method musteither catch the exception or declare it in its throws clause.