Halloween Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: save70

Changed GSSP-Java Exam Questions

Page: 4 / 10
Total 275 questions

GIAC Secure Software Programmer - Java Questions and Answers

Question 13

Which of the following methods causes the currently executing thread object to temporarily pause and allow other threads to execute?

Options:

A.

sleep()

B.

notify()

C.

finalize()

D.

interrupted()

E.

yield()

F.

notifyAll()

Question 14

Which of the following statements can be used by a Programmer to suggest the JVM to perform garbage collection?

Options:

A.

Runtime.getRuntime().freeMemory();

B.

Runtime.getRuntime().totalMemory();

C.

new Thread().destroy();

D.

System.gc();

E.

System.runFinalization();

F.

System.setOut();

Question 15

Which of the following statements about the String, StringBuffer, and StringBuilder classes are true?

Each correct answer represents a complete solution. Choose all that apply.

Options:

A.

The StringBuffer class offers faster performance than the StringBuilder class.

B.

The StringBuffer class is thread-safe while the StringBuilder class is not.

C.

A character in a string can be searched using the indexOf() operator.

D.

The return type of the trim() method present in the String class is void.

Question 16

You write the following code.

class Father {public void Method() {System.out.println("I am Father");}}

public class Son extends Father {public static void main(String argv[]) {Son son = new Son();son.Method();}

private void Method() {System.out.println("I am Son");}}

Which of the following will be the result, when you try to compile and run the code?

Options:

A.

I am Father will be displayed as the output.

B.

A runtime error will result.

C.

I am Son will be displayed as the output.

D.

The code will execute but without displaying any output.

E.

A compile-time error will result.

Page: 4 / 10
Total 275 questions