Choose a topic to test your knowledge and improve your Java skills
Which of the following declares an abstract method in an abstract Java class?
Which of the following statements regarding abstract classes are true?
Which of the following is a correct interface?
Given the following piece of code: public interface Guard{void doYourJob(); } abstract public class Dog implements Guard{ } which of the following statements is correct?
Runnable is a _____ .
Which is true?
The concept of multiple inheritance is implemented in Java by
The class at the top of exception class hierarchy is .................
In which of the following package Exception class exist?
Exception generated in try block is caught in ........... block.
Which keyword is used to explicitly throw an exception?
Which exception is thrown when divide by zero statement executes?
Which keyword is used to specify the exception thrown by method?
Which of the following blocks execute compulsorily whether exception is caught or not.
What happen in case of multiple catch blocks?
Which exception is thrown when an array element is accessed beyond the array size?
public class Test{public static void main(String args[]){ int a = Integer.parseInt("four"); }}} Which exception could be handled by the catch block for above?
try{ File f = new File("a.txt"); }catch(Exception e){ }catch(IOException io){ } Is this code create new file name a.txt ?
In java a thread can be created by ..........
When a class extends the Thread class ,it should override ............ method of Thread class to start that thread.
Which of the following constructor of class Thread is valid one?
Analyze the following code: public abstract class Test implements Runnable{ public void doSomething() { }; }
Analyze the following code: public class Test implements Runnable{public static void main(String[] args){Test t = new Test(); t.start(); }public void run() { } }
�Which of the following are methods of the Thread class?
Output : public class Test implements Runnable{public void run(){System.out.print("go");}public static void main(String arg[]){Thread t = new Thread(new Test()); t.run(); t.run(); t.start();}}
System class is defined in .................
try{File f = new File("a.txt"); }catch(Exception e){ }catch(IOException io){ } Is this code create new file name a.txt ?
Which of these classes defined in java.io and used for file-handling are abstract?
When comparing java.io.BufferedWriter and java.io.FileWriter, which capability exist as a method in only one of two ?
What is the range of data type short in Java?
What is the range of data type byte in Java?
An expression involving byte, int, and literal numbers is promoted to which of these?
Which of these literals can be contained in a data type float variable?
Which data type value is returned by all transcendental math functions?
What is the numerical range of a char in Java?
Which of these coding types is used for data type characters in Java?
Which of these values can a boolean variable contain?
Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?
Which one is a valid declaration of a boolean?
Output : class mainclass { public static void main(String args[]) { boolean var1 = true; boolean var2 = false; if (var1) System.out.println(var1); else System.out.println(var2); } }
Which of these functions is called to display the output of an applet?
Which of these methods can be used to output a sting in an applet?
What does AWT stands for?
Which of these methods is a part of Abstract Window Toolkit (AWT) ?
Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?
Which of these operators can be used to get run time information about an object?
Which of these packages contain all the collection classes?