GIAC Secure Software Programmer - Java - GSSP-JaVa Exam Practice Test

Dennis works as a Programmer in Broadnet Inc. He writes the following program.
1.public class Ques0307{
2.public static void main(String[] argv){
3.int arr[] = {1, 2, 3, 4};
4.try{
5.int k = 0;
6.for(; k < 4; k++)
7.arr[k] = arr[k] + 1;
8.System.out.println("try");
9.}
10.
catch(ArrayIndexOutOfBoundsException a){
11.
System.out.println("index " +k +" not found");
12.
}
13.
catch(Exception e){
14.
System.out.println("catch1");
15.
}
16.
finally{
17.
System.out.println("finally");
18.
}
19.
}
20.
}
What will happen when Dennis attempts to compile and execute the program?
Correct Answer: A
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
Correct Answer: B,C,D
Which of the following listeners causes an object of the implementing class to be notified when it is added to or removed from a session?
Correct Answer: D
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.
Correct Answer: B,C
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
Correct Answer: A,C
Which of the following will be returned by the expression "string" instanceof String?
Correct Answer: D
Which of the following are marker interfaces?
Each correct answer represents a complete solution. Choose all that apply.
Correct Answer: C,D
Which of the following exceptions will be thrown if the checkSecurityAccess() method uses an empty target as its parameter value?
Correct Answer: B
Which of the following methods belongs to the Refreshable interface?
Correct Answer: D
Mary works as a Software Developer for XYZ Inc. She writes the following code.
1.class Alpha {
2.public static class Beta { }
3.}
4.class Delta {
5.// insert code here
6.}
Which of the following code statements can be inserted at line 5 to create an instance of the Beta class defined in the class Alpha?
Correct Answer: C
Which of the following is used to restore the objects that have been previously serialized by a stream?
Correct Answer: B
Which of the following statements about the <web-resource-collection> element are true? Each correct answer represents a complete solution. Choose all that apply.
Correct Answer: C,D
Which of the following methods causes the currently executing thread object to temporarily pause and allow other threads to execute?
Correct Answer: C
What will be the output of the following code snippet?
class test22
{
public static void main(String args[])
{
String str= new String("Hello");
str.insert(3,"bye");
System.out.println(str);
}
}
Correct Answer: D
Mark works as a Programmer for InfoTech Inc. He develops a Web application that takes input from users. Which of the following methods can be used by the client and server to validate the users input?
Each correct answer represents a complete solution. Choose all that apply.
Correct Answer: A,B
0
0
0
0