Which of the following are marker interfaces?
Each correct answer represents a complete solution. Choose all that apply.
A. The Clonable interface
B. The Serializable interface
C. The Comparable interface
D. The Runnable interface
Harry works as a Software Developer for SoftTech Inc. He has developed a Java application to perform various SQL statements such as INSERT, UPDATE, etc., against a database table named Employee. He has used the executeUpdate() method to perform various SQL queries and to know the exact affected rows in the database if any of the operations is performed against the database table. Which of the following types of values is returned by this method?
A. Double
B. Integer
C. Float
D. String
Which of the following code fragments will throw NumberFormatException?
A. Double dbl = new Double(true);
B. Character ch = new Character('A');
C. Float flt = new Float("true");
D. Boolean bool = new Boolean("123");
Mark develops an application using Java language. He writes the following code snippet in the application.
public class mClass{
public static void main(String args[]){
try{
return;
}
finally{System.out.print("Finally");}}}
What will happen when Mark attempts to compile and execute the code snippet?
A. The code snippet will compile successfully and the output will be displayed as "Finally".
B. The code snippet will compile successfully, but an exception message will be displayed at runtime.
C. A compile time error will occur because the catch block is not defined.
D. The code snippet will compile successfully, but nothing will be displayed as output on execution.
Which of the following statements about the isUserInRole() method are true? Each correct answer represents a complete solution. Choose all that apply.
A. It accepts a boolean argument.
B. It is mapped in the deployment descriptor using the
C. It belongs to the HttpServletResponse interface.
D. The
Which of the following conditions must be satisfied before the HTTP client authentication mechanism is
used?
Each correct answer represents a complete solution. Choose all that apply.
A. The client must have a valid public key certificate.
B. The SSL support must be configured for the server.
C. It must create the error and login form pages.
D. The Base64 encoding must be used for sending user names and passwords over the Internet.
You work as a Software Developer for Developer Inc. You write the following code.
interface A {public boolean b = false;}
class C implements A {public static void main(String args[]) {b = true;System.out.println(b);}} Which of the
following will be the result, when you try to compile and execute the above code?
A. The code will compile and print false.
B. The code will compile, but it will not execute.
C. The code will compile and print true.
D. The code will not compile.
Identify whether the given statement is true or false. "An object becomes eligible for garbage collection when it becomes unreachable by any code."
A. False
B. True
Which of the following deployment descriptor elements is used to declare the reference of a client's application to an external resource?
A.
B.
C.
D.
You have written the following code snippet.
1.
public class Read {
2.
protected int ReadText(int x) { return 0; }
3.
}
4.
class Text extends Read {
5.
/*insert code here*/
6.
}
Which of the following methods, inserted independently at line 5, will compile? Each correct answer
represents a complete solution. Choose all that apply.
A. private int ReadText(long x) { return 0; }
B. protected long ReadText(int x, int y) { return 0; }
C. protected long ReadText(long x) { return 0; }
D. protected int ReadText(long x) { return 0; }
E. private int ReadText(int x) { return 0; }
F. public int ReadText(int x) { return 0; }
G. protected long ReadText(int x) { return 0; }