Given a code of a class named PrintString that prints a string.
1. public class PrintString{
2. public static void main(String args[]){
3. /*insert code here */
4. /* insert code here */
5. System.out.println(str);
6. }
7. }
Which of the following code fragments can be inserted in the class PrintString to print the output
"4247"?
Each correct answer represents a complete solution. Choose all that apply.
A,B
Mark writes a class Practice.java. This class needs to access the com.bar.Test class that is stored in the
Test.jar file in the directory /practice. How would you compile your code?
A
Which of the following statements is true?
E
John works as a Programmer for Technostar Inc. He writes the following code using Java.
1. class WrapperClass{
2. public static void main(String[] argv){
3. String str2 = Double.toString(12);
4. String str1 = Double.toHexString(12);
5. System.out.println(str1+str2);
6. }
7. }
What will happen when John attempts to compile and execute the code?
C
Mark works as a Programmer for InfoTech Inc. He develops a Website that uses HTML and processes
HTML validation. Which of the following are the advantages of the HTML application?
Each correct answer represents a complete solution. Choose all that apply.
B,C,D,F
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,B,C,D,F
You work as a Software Developer for UcTech Inc. You create a session using the HttpSession
interface. You want the attributes to be informed when the session is moved from one JVM to
another and also when an attribute is added or removed from the session. Which of the following
interfaces can you use to accomplish the task? Each correct answer represents a complete solution.
Choose all that apply.
C,D
Which of the following statements are true? Each correct answer represents a complete solution.
Choose all that apply.
C,D
You work as a programmer for uCertify.Inc. You have a session object named session1 with an
attribute named Attribute1, and an HttpSessionBindingEvent object binding1 bound to session1.
Which of the following will be used to retrieve Attribute1? Each correct answer represents a
complete solution. Choose all that apply.
A,E
Which of the following statements about a JAR file are true? Each correct answer represents a
complete solution. Choose all that apply.
B,C,D