GIAC GSSP-Java Exam Practice Questions (P. 4)
- Full Access (275 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #16
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.
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.
- Aprivate int ReadText(long x) { return 0; }
- Bprotected long ReadText(int x, int y) { return 0; }
- Cprotected long ReadText(long x) { return 0; }
- Dprotected int ReadText(long x) { return 0; }
- Eprivate int ReadText(int x) { return 0; }
- Fpublic int ReadText(int x) { return 0; }
- Gprotected long ReadText(int x) { return 0; }
Correct Answer:
ABCDF
ABCDF
send
light_mode
delete
Question #17
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.
Each correct answer represents a complete solution. Choose all that apply.
- AHttpSessionBindingListener
- BHttpSessionListener
- CHttpSessionActivationListener
- DHttpSessionAttributeListener
Correct Answer:
CD
CD
send
light_mode
delete
Question #18
Which of the following statements are true?
Each correct answer represents a complete solution. Choose all that apply.
Each correct answer represents a complete solution. Choose all that apply.
- AAn inner class cannot be defined as private.
- BAn inner class cannot be defined as protected.
- CAn inner class can be defined as private.
- DAn inner class can extend another class.
Correct Answer:
CD
CD
send
light_mode
delete
Question #19
You work as a programmer for PassGuide.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.
Which of the following will be used to retrieve Attribute1?
Each correct answer represents a complete solution. Choose all that apply.
- AObject obj=binding1.getSession().getAttribute("Attribute1");
- BObject obj=binding1.getAttribute("Attribute1");
- CLong MyAttribute=session1.getAttribute("Attribute1");
- DString str1=session1.getAttribute("Attribute1");
- EObject obj=session1.getAttribute("Attribute1");
Correct Answer:
AE
AE
send
light_mode
delete
Question #20
Which of the following statements about a JAR file are true?
Each correct answer represents a complete solution. Choose all that apply.
Each correct answer represents a complete solution. Choose all that apply.
- AIt cannot be accessed through a class path, nor they can be used by java and javac.
- BIt is used to compress and archive data.
- CIt can be moved from one computer to another.
- DIt is created by using the jar command.
Correct Answer:
BCD
BCD
send
light_mode
delete
All Pages