Professional Documents
Culture Documents
Click to Here
तम्हला नोकरीच्या संदर्भ मध्ये काही update माहहती आमच्या या चॅनेल वर र्ेटलं
join Click To Here
तम्हाला जर नोकरी साठी तुम्हाला लागणारे daily current affair | notes | ebooks
Join Click to Here
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Seat No -
Total number of questions : 60
11393_CS 335 PROGRAMMING IN JAVA I
Time : 1hr
Max Marks : 50
N.B
1) All questions are Multiple Choice Questions having single correct option.
7) Use only black/blue ball point pen to darken the appropriate circle.
Q.no 1. Which method is used to set the graphics current color to the specified color in the
graphics class?
B : An html file
C : Both A & B
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 1/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 4. Which are passive controls that do not support any interaction with the user?
A : Choice
B : List
C : Checkbox
D : Labels
A : Class
B : Interface
C : Abstract class
D : Other
Q.no 6. Which of this method of class StringBuffer is used to concatenate the string
representation to the end of invoking string?
A : concat()
B : append()
C : join()
D : concatenate()
Q.no 7. Which of these keywords must be used to handle the exception thrown by try block in
some rational manner?
A : try
B : catch
C : throw
D : finaly
A : try
B : catch
C : thrown
D : finaly
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 2/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 9. Which method is called only once during the run time of your applet?
A : stop()
B : paint()
C : destroy()
D : init()
Q.no 10. Which of the following classes can catch all exceptions which cannot be caught?
A : RuntimeException
B : Error
C : Exception
D : ParentException
A : Button
B : Label
C : FlowLayout
D : TextField
A : getStatus( )
B : getState( )
C : isChecked( )
D : getChecked( )
Q.no 13. Which of the following is true about interfaces in java? Consider an interface that
has 5 methods in it.
A : A class can implement few methods which is required for the class.
Q.no 15. Which of these values are returns under the case of normal termination of a
program?
A:0
B:1
C:2
D:3
Q.no 16. Which is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
A : Window
B : container
C : Panel
D : Frame
Q.no 17. What is the value of “d” in the following Java code snippet? Double d = Math.round (
2.5 + Math.random() );
A:2
B:3
C:4
D : 2.5
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 4/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : replace() method replaces first occurrence of a character in invoking string with another
character
D : replace() method replaces last occurrence of a character in invoking string with another
character
D : Both A & B
Q.no 21. Which part of code gets executed whether exception is caught or not?
A : try
B : catch
C : throw
D : finally
A : final class
B : Object class
C : abstract class
D : child class
Q.no 23. Which one is correct declaration for implementing two interfaces? Consider,
Interface A and B. class C wants to implements both interfaces.
B : class C implements A, B
Q.no 24. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 5/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
D : all of above
Q.no 25. Which of the following applet tags is legal to embed an applet class named Test into a
webpage?
B : <applet>
code=Test.class width=200 height=100>
</applet>
C : <applet
code=Test.class width=200 height=100>
</applet>
D : <applet
param=Test.class width=200 height=100>
</applet>
Q.no 26. Which of these operators can be used to get run time information about an object?
A : getInfo
B : Info
C : instanceof
D : getinfoof
Q.no 27. Which of the following keyword is used by calling function to handle exception
thrown by called function?
A : throws
B : throw
C : try
D : catch
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 6/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
(c) getSelectedIndex( )
(d) getItem( )
A : Both a & d
B : only b
C : a ,b, c & d
D : only a
Q.no 30. Which of the following methods can be used to draw the outline of a square within a
java.awt.Component object?
(A) fillRect()
(B) drawLine()
(C) drawRect()
(D) drawString()
(E) drawPolygon()
Q.no 31. which of the following is true about methods in an interface in java?
C : Private and protected access modifiers can also be used to declare methods in interface
A : only a
B : only b
C : only c
Q.no 33. Which of the following is true about AWT and Swing components.
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 7/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 34. Which applet java.awt.component class provides the life cycle method?
Q.no 35. Which of these exceptions handles the divide by zero error?
A : ArithmeticException
B : MathException
C : IllegalAccessException
D : IllegarException
Q.no 36. Which of these method of Object class can generate duplicate copy of the object on
which it is called?
A : clone()
B : copy()
C : duplicate()
D : dito()
A : A,B &C
B : A,B,C & D
C : B, C & D
D : A,C &D
Q.no 38. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
A : substring()
B : Substring()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 8/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : SubString()
D : sub()
A : class
B : interface
C : implements
D : abstract
C : There can be only abstract methods in the interface not method body.
Q.no 41. The setBackground() method is part of the following class in java.awt package:
A : Component
B : Graphics
C : Container
D : Applet
Q.no 43. Which of the following methods can be used to remove a java.awt.Component object
from the display?
A : remove()
B : hide()
C : disappear()
D : delete()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 9/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A:5
B:6
C:7
D:8
Q.no 45. Which of these class contains only floating point functions?
A : Math
B : Process
C : System
D : Object
Q.no 46. Which class provides many methods for graphics programming?
A : java.awt
B : java.Graphics
C : ava.awt.Graphics
Q.no 47. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
C : Browser
Q.no 48. Which of these class is related to all the exceptions that are explicitly thrown?
A : Error
B : Exception
C : Throwable
D : Throw
Q.no 49. Which is a component in AWT that can contain another component like buttons, text
fields, labels etc.?
A : Window
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 10/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : Container
C : Panel
D : Frame
A : ComponentEvent
B : ContainerEvent
C : ItemEvent
D : InputEvent
Q.no 51. Which of these events will be notified if scroll bar is manipulated?
A : ActionEvent
B : ComponentEvent
C : AdjustmentEvent
D : WindowEvent
Q.no 52. Which of these classes are the direct subclasses of the Throwable class?
A : put()
B : putFile()
C : write()
D : writeFile()
Q.no 54. In which process, a local variable has the same name as one of the instance variables?
A : Serialization
B : Variable Shadowing
C : Abstraction
D : Multi-threading
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 11/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 55. To use the ActionListener interface it must be implemented by a class there are
several ways to do that find in the following?
A. Creating a new class B. Using the class the graphical component C. An anonymous inner
class
A:A&B
B:A&c
C : A,B & C
D:B&C
A : Files.delete(path)
B : Files.deleteDir()
C : Directory.delete()
D : Directory.delete(path)
Q.no 60. What will be the output of the following Java program? class output
{
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 12/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
}}
A : hello
B : helwo
C : hewwo
D : hewlo
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 13/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 1. Which of these methods of class String is used to check whether a given object
startswith a particular string literal?
A : startsWith()
B : endsWith()
C : Starts()
D : ends()
A : Exception Handling
B : String Handling
C : Event Handling
B : display( )
C : print( )
D : transient( )
A : setText()
B : getText()
C : Both A & B
Q.no 5. Which method is used to set the graphics current color to the specified color in the
graphics class?
A : get()
B : Sizeof()
C : length()
D : lengthof()
Q.no 7. When an applet is terminated which of the following sequence of methods calls take
place?
A : stop(),paint(),destroy()
B : destroy(),stop(),paint()
C : destroy(),stop()
D : stop(),destroy()
A : try
B : catch
C : throw
D : finaly
Q.no 9. Which is used to store data and partial results, as well as to perform dynamic linking,
return values for methods, and dispatch exceptions?
A : Window
B : Panel
C : Frame
D : Container
A : try
B : catch
C : thrown
D : finaly
A : ComponentEvent
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 15/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : ContainerEvent
C : ItemEvent
D : InputEvent
Q.no 12. Which applet java.awt.component class provides the life cycle method?
Q.no 13. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
D : all of above
Q.no 14. Which is the container that doesn't contain title bar and MenuBars but it can have
other components like button, textfield etc?
A : Window
B : Frame
C : Panel
D : Container
Q.no 15. Which class provides many methods for graphics programming?
A : java.awt
B : java.Graphics
C : ava.awt.Graphics
Q.no 16. Which of the following applet tags is legal to embed an applet class named Test into a
webpage?
B : <applet>
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 16/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
code=Test.class width=200 height=100>
</applet>
C : <applet
code=Test.class width=200 height=100>
</applet>
D : <applet
param=Test.class width=200 height=100>
</applet>
Q.no 18. What is the value of “d” in the following Java code snippet? Double d = Math.round (
2.5 + Math.random() );
A:2
B:3
C:4
D : 2.5
Q.no 19. which of the following is true about methods in an interface in java?
C : Private and protected access modifiers can also be used to declare methods in interface
Q.no 20. Which of the following handles the exception when a catch is not used?
A : finally
B : throw handler
C : default handler
Q.no 21. Which of these method of Object class can generate duplicate copy of the object on
which it is called?
A : clone()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 17/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : copy()
C : duplicate()
D : dito()
A : getStatus( )
B : getState( )
C : isChecked( )
D : getChecked( )
A : Both a & d
B : only b
C : a ,b, c & d
D : only a
Q.no 24. Which are the valid ways to create DataInputStream streams?
A : new DataInputStream();
Q.no 25. Which of these class encapsulate the runtime state of an object or an interface?
A : Class
B : Object
C : Runtime
D : System
A : class
B : interface
C : implements
D : abstract
Q.no 28. Can data flow through a given stream in both directions?
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
A : final class
B : Object class
C : abstract class
D : child class
Q.no 30. Which of these class is related to all the exceptions that are explicitly thrown?
A : Error
B : Exception
C : Throwable
D : Throw
Q.no 31. Which of these modifiers can be used for a variable so that it can be accessed from
any thread or parts of a program?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 19/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : transient
B : volatile
C : global
D : No modifier is needed
Q.no 32. Which of these functions is called to display the output of an applet?
A : display()
B : paint()
C : displayApplet()
D : PrintApplet()
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
Q.no 34. Which of the following methods can be used to change the size of a
java.awt.Component object?
(A) dimension()
(B) setSize()
(C) area()
(D) size()
(E) resize()
Q.no 35. Which of these methods can be used to output a string in an applet?
A : display()
B : print()
C : drawString()
D : transient()
Q.no 36. Which part of code gets executed whether exception is caught or not?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 20/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : try
B : catch
C : throw
D : finally
Q.no 37. Which of these values are returns under the case of normal termination of a
program?
A:0
B:1
C:2
D:3
Q.no 38. Which of these exceptions handles the divide by zero error?
A : ArithmeticException
B : MathException
C : IllegalAccessException
D : IllegarException
Q.no 39. Which of these operators can be used to get run time information about an object?
A : getInfo
B : Info
C : instanceof
D : getinfoof
Q.no 40. Which method is first Called for any applet when it starts its execution?
A : void destroy()
B : void start()
C : void init()
D : boolean isActive()
Q.no 41. Which of the following methods can be used to remove a java.awt.Component object
from the display?
A : remove()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 21/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : hide()
C : disappear()
D : delete()
Q.no 42. Which of the following methods can be used to draw the outline of a square within a
java.awt.Component object?
(A) fillRect()
(B) drawLine()
(C) drawRect()
(D) drawString()
(E) drawPolygon()
Q.no 43. What will be the output of the following Java program? class A
{ int i; }
class B extends A
{ int j;
void display()
{
super.i = j + 1;
System.out.println(j + " " + i);
}}
class inheritance {
public static void main(String args[])
{
B obj = new B();
obj.i=1; obj.j=2;
obj.display(); } }
A:22
B:33
C:23
D:32
Q.no 44. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
C : Browser
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 22/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
D : None of the above
A : ArithmeticException
B : ClassNotFoundException
C : NullPointerException
D : NumberFormatException
Q.no 46. Which of the following is a super class of all exception type classes?
A : Catchable
B : RuntimeExceptions
C : String
D : Throwable
A : only a
B : only b
C : only c
Q.no 48. The Swing Component classes that are used in Encapsulates a mutually exclusive set
of buttons?
A : AbstractButto
B : ButtonGroup
C : JButton
D : ImageIcon
A : A,B &C
B : A,B,C & D
C : B, C & D
D : A,C &D
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 23/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 50. DataInput is
Q.no 51. In which process, a local variable has the same name as one of the instance variables?
A : Serialization
B : Variable Shadowing
C : Abstraction
D : Multi-threading
B : Runnable Interface
C : Marker Interface
D : Abstract Interface
Q.no 53. What is it called if an object has its own lifecycle and there is no owner?
A : Aggregation
B : Composition
C : Encapsulation
D : Association
Q.no 54. The .......................... attribute of applet tag specifies the amount of horizontal blank
space the browser should leave surrounding the applet.
A : SPACE=pixels
B : HSPACE=piexls
C : HWIDTH=piexls
D : HBLANK=pixels
Q.no 55. Which of these points will be valid If superclass method does not throw any exception
D : All of these
Q.no 56. Which of these methods can be used to change location of an event?
A : ChangePoint()
B : TranslatePoint()
C : ChangeCordinates()
D : TranslateCordinates()
A : TEXT_CHANGED
B : TEXT_FORMAT_CHANGED
C : TEXT_VALUE_CHANGED
D : TEXT_sIZE_CHANGED
Q.no 58. Which of the following is true about the anonymous inner class?
A : put()
B : putFile()
C : write()
D : writeFile()
A : String
B : Object
C : void
D : Function
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 25/13
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
Seat No -
A : String()
B : String(void)
C : String(0)
D : new String()
A : java.util
B : java.lang
C : ArrayList
A : Run Time
B : Compilation Time
D : Prepocessing
A : Exception Handling
B : String Handling
C : Event Handling
https://sppu.wheebox.com/WAC-3/openanswers.obj 26/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
D : None of the above
Q.no 6. Which method is called only once during the run time of your applet?
A : stop()
B : paint()
C : destroy()
D : init()
A : Button,List,MenuItem
B : Button,Checkbox,Choice
C : Scrollbar,Component,Button
A : setText()
B : getText()
C : Both A & B
Q.no 9. Which are passive controls that do not support any interaction with the user?
A : Choice
B : List
C : Checkbox
D : Labels
Q.no 10. Which of these method of class StringBuffer is used to find the length of current
character sequence?
A : Length()
B : length()
C : capacity()
D : Capacity()
Q.no 11. Which of these operators can be used to get run time information about an object?
https://sppu.wheebox.com/WAC-3/openanswers.obj 27/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
A : getInfo
B : Info
C : instanceof
D : getinfoof
C : Random order
D : LIFO order
Q.no 15. Which of the following keyword is used by calling function to handle exception
thrown by called function?
A : throws
B : throw
C : try
D : catch
C : There can be only abstract methods in the interface not method body.
https://sppu.wheebox.com/WAC-3/openanswers.obj 28/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
D : Object of an interface cannot be created.
A : ComponentEvent
B : ContainerEvent
C : ItemEvent
D : InputEvent
A : getStatus( )
B : getState( )
C : isChecked( )
D : getChecked( )
Q.no 19. Which of these class contains only floating point functions?
A : Math
B : Process
C : System
D : Object
Q.no 20. Which of the following is true about AWT and Swing components.
A : only a
B : only b
C : only c
https://sppu.wheebox.com/WAC-3/openanswers.obj 29/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
Q.no 22. Which of the following is a super class of all exception type classes?
A : Catchable
B : RuntimeExceptions
C : String
D : Throwable
Q.no 23. Which of these modifiers can be used for a variable so that it can be accessed from
any thread or parts of a program?
A : transient
B : volatile
C : global
D : No modifier is needed
Q.no 24. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
A : substring()
B : Substring()
C : SubString()
D : sub()
C : replace() method replaces first occurrence of a character in invoking string with another
character
D : replace() method replaces last occurrence of a character in invoking string with another
character
A : Both a & d
B : only b
C : a ,b, c & d
https://sppu.wheebox.com/WAC-3/openanswers.obj 30/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
D : only a
Q.no 27. which of the following is true about methods in an interface in java?
C : Private and protected access modifiers can also be used to declare methods in interface
Q.no 28. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
D : all of above
Q.no 29. What is the name of a stream that connects two running programs?
B : Processing stream.
C : Pipe
D : Channel
Q.no 30. Which method is first Called for any applet when it starts its execution?
A : void destroy()
B : void start()
C : void init()
D : boolean isActive()
A : class
B : interface
C : implements
D : abstract
Q.no 32. Which of these methods can be used to output a string in an applet?
https://sppu.wheebox.com/WAC-3/openanswers.obj 31/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
A : display()
B : print()
C : drawString()
D : transient()
Q.no 33. Which of these exceptions handles the divide by zero error?
A : ArithmeticException
B : MathException
C : IllegalAccessException
D : IllegarException
A : Same class
B : Other class
C : Anonymous class
Q.no 35. Which of these values are returns under the case of normal termination of a
program?
A:0
B:1
C:2
D:3
A : A,B &C
B : A,B,C & D
C : B, C & D
D : A,C &D
Q.no 37. Which of these class is used to read from byte array?
A : InputStream
B : BufferedInputStream
https://sppu.wheebox.com/WAC-3/openanswers.obj 32/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
C : ArrayInputStream
D : ByteArrayInputStream
Q.no 38. Which are the valid ways to create DataInputStream streams?
A : new DataInputStream();
Q.no 39. Which is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
A : Window
B : container
C : Panel
D : Frame
Q.no 40. When an applet begins, in which sequence will the AWT call the methods?
A : init(),paint(),start()
B : Start(),paint(),init()
C : paint(),start(),init()
D : intit(),start(),paint()
A : only a
B : only b
C : only c
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
Q.no 44. Which of these operator is used to generate an instance of an exception than can be
thrown by using throw?
A : new
B : malloc
C : alloc
D : thrown
Q.no 45. Can data flow through a given stream in both directions?
C : Yes; but only one direction at a time. Yes; but only one direction at a time. Yes; but only one
direction at a time.
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
D : Both A & B
Q.no 47. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
C : Browser
Q.no 48. Which one is correct declaration for implementing two interfaces? Consider,
Interface A and B. class C wants to implements both interfaces.
B : class C implements A, B
Q.no 49. Which of the following is method of wrapper Integer for converting the value of an
object into int?
A : bytevalue()
B : int intValue();
C : Bytevalue()
D : Byte Bytevalue()
Q.no 50. Which of the following methods can be used to change the size of a
java.awt.Component object?
(A) dimension()
(B) setSize()
(C) area()
(D) size()
(E) resize()
Q.no 51. Arrange the steps involved in developing and testing the applet in correct order.
i) creating an executable applet (.classfile)
ii) preparing <APPLET> tag
iii) creating HTML file
iv) building an applet code (.java file)
v) testing the applet code
Q.no 52. Which of the following is true about the anonymous inner class?
https://sppu.wheebox.com/WAC-3/openanswers.obj 35/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
A : It has only methods
Q.no 53. What will be the output of the following Java program? class output
{
public static void main(String args[])
{
String s1 = "Hello"; String s2 = s1.replace('l','w'); System.out.println(s2);
}}
A : hello
B : helwo
C : hewwo
D : hewlo
B : Object
C : void
D : Function
Q.no 55. Which of these methods can be used to determine the type of event?
A : getSource()
B : getId()
C : getEvent()
D : getEventObject()
Q.no 56. Which of these methods are used to register a mouse motion listener?
A : addMouse()
B : addMouseListener()
C : addMouseMotionListner()
D : eventMouseMotionListener()
Q.no 57. Which package provides many event classes and Listener interfaces for event
handling?
https://sppu.wheebox.com/WAC-3/openanswers.obj 36/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
A : java.awt
B : ava.awt.Graphics
C : java.awt.event
Q.no 58. Which of the following is/are the possible values for alignment attribute of Applet
tag.
i) Top ii) Left iii) Middle iv) Baseline
Q.no 59. In Graphics class which method is used to draws a rectangle with the specified width
and height?
C : public abstract void drawLine(int x1, int y1, int x2, int y2)
Q.no 60. Which of these classes are the direct subclasses of the Throwable class?
https://sppu.wheebox.com/WAC-3/openanswers.obj 37/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
Q.no 1. Which of these method of class String is used to compare two String objects for their
equality?
A : equals()
B : Equals()
C : isequal()
D : Isequal()
Q.no 2. Which are passive controls that do not support any interaction with the user?
A : Choice
B : List
C : Checkbox
D : Labels
B : Swing
C : Both A & B
A : try
B : catch
C : throw
D : finaly
A : Run Time
B : Compilation Time
https://sppu.wheebox.com/WAC-3/openanswers.obj 38/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
D : Prepocessing
Q.no 7. Which of these method of class StringBuffer is used to find the length of current
character sequence?
A : Length()
B : length()
C : capacity()
D : Capacity()
Q.no 8. Which object can be constructed to show any number of choices in the visible
window?
A : Choice
B : Labels
C : List
D : choicebox
A : Button,List,MenuItem
B : Button,Checkbox,Choice
C : Scrollbar,Component,Button
A:7
B:4
C:9
D:8
A : final class
B : Object class
C : abstract class
D : child class
Q.no 12. Can data flow through a given stream in both directions?
C : Yes; but only one direction at a time. Yes; but only one direction at a time. Yes; but only one
direction at a time.
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
Q.no 13. Which is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
A : Window
B : container
C : Panel
D : Frame
Q.no 14. Which of the following keyword is used by calling function to handle exception
thrown by called function?
A : throws
B : throw
C : try
D : catch
Q.no 15. Which of these operator is used to generate an instance of an exception than can be
thrown by using throw?
A : new
B : malloc
C : alloc
D : thrown
Q.no 16. which of the following is true about methods in an interface in java?
https://sppu.wheebox.com/WAC-3/openanswers.obj 40/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
C : Private and protected access modifiers can also be used to declare methods in interface
Q.no 17. Which method is first Called for any applet when it starts its execution?
A : void destroy()
B : void start()
C : void init()
D : boolean isActive()
Q.no 18. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
C : Browser
Q.no 19. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
A : substring()
B : Substring()
C : SubString()
D : sub()
Q.no 20. Which of these functions is called to display the output of an applet?
A : display()
B : paint()
C : displayApplet()
D : PrintApplet()
https://sppu.wheebox.com/WAC-3/openanswers.obj 41/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
B : an abstract class defined in java.io.
A : A,B &C
B : A,B,C & D
C : B, C & D
D : A,C &D
Q.no 23. What is the value of “d” in the following Java code snippet? Double d = Math.round (
2.5 + Math.random() );
A:2
B:3
C:4
D : 2.5
Q.no 24. Which of these values are returns under the case of normal termination of a
program?
A:0
B:1
C:2
D:3
Q.no 25. Which of the following is true about interfaces in java? Consider an interface that
has 5 methods in it.
A : A class can implement few methods which is required for the class.
Q.no 26. Which of these class is used to read from byte array?
A : InputStream
B : BufferedInputStream
https://sppu.wheebox.com/WAC-3/openanswers.obj 42/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
C : ArrayInputStream
D : ByteArrayInputStream
Q.no 27. Which of the following is method of wrapper Integer for converting the value of an
object into int?
A : bytevalue()
B : int intValue();
C : Bytevalue()
D : Byte Bytevalue()
Q.no 28. Which of the following handles the exception when a catch is not used?
A : finally
B : throw handler
C : default handler
Q.no 30. Which of the following methods can be used to change the size of a
java.awt.Component object?
(A) dimension()
(B) setSize()
(C) area()
(D) size()
(E) resize()
Q.no 31. What will be the output of the following Java program? class A
{ int i; }
https://sppu.wheebox.com/WAC-3/openanswers.obj 43/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
class B extends A
{ int j;
void display()
{
super.i = j + 1;
System.out.println(j + " " + i);
}}
class inheritance {
public static void main(String args[])
{
B obj = new B();
obj.i=1; obj.j=2;
obj.display(); } }
A:22
B:33
C:23
D:32
Q.no 32. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
D : all of above
Q.no 33. Which one is correct declaration for implementing two interfaces? Consider,
Interface A and B. class C wants to implements both interfaces.
B : class C implements A, B
Q.no 34. Which of these class contains only floating point functions?
A : Math
B : Process
C : System
D : Object
C : "X extends Y" is correct if X and Y are either both classes or both interfaces
D : "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
Q.no 36. Which of these operators can be used to get run time information about an object?
A : getInfo
B : Info
C : instanceof
D : getinfoof
Q.no 37. Which are the valid ways to create DataInputStream streams?
A : new DataInputStream();
Q.no 38. What is the name of a stream that connects two running programs?
B : Processing stream.
C : Pipe
D : Channel
Q.no 39. The setBackground() method is part of the following class in java.awt package:
A : Component
B : Graphics
C : Container
D : Applet
Q.no 40. Which of these modifiers can be used for a variable so that it can be accessed from
any thread or parts of a program?
A : transient
B : volatile
https://sppu.wheebox.com/WAC-3/openanswers.obj 45/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
C : global
D : No modifier is needed
A : Both a & d
B : only b
C : a ,b, c & d
D : only a
A : only a
B : only b
C : only c
A : only a
B : only b
C : only c
Q.no 44. Which class provides many methods for graphics programming?
A : java.awt
B : java.Graphics
C : ava.awt.Graphics
Q.no 45. Which of these exceptions handles the divide by zero error?
https://sppu.wheebox.com/WAC-3/openanswers.obj 46/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
A : ArithmeticException
B : MathException
C : IllegalAccessException
D : IllegarException
Q.no 47. Which of these class is related to all the exceptions that are explicitly thrown?
A : Error
B : Exception
C : Throwable
D : Throw
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
A : Button
B : Label
C : FlowLayout
D : TextField
https://sppu.wheebox.com/WAC-3/openanswers.obj 47/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
C : A subclass is a class declared outside a class
Q.no 51. Which of the following is true about the anonymous inner class?
A : createLink()
B : createSymLink()
C : createSymbolicLink()
D : createTempLink()
A : put()
B : putFile()
C : write()
D : writeFile()
A : java.util package
B : java.lang package
C : java.awt package
D : java.io package
Q.no 57. In Graphics class which method is used to draws a rectangle with the specified width
and height?
C : public abstract void drawLine(int x1, int y1, int x2, int y2)
Q.no 58. Which of these methods can be used to determine the type of event?
A : getSource()
B : getId()
C : getEvent()
D : getEventObject()
Q.no 59. What is meant by the classes and objects that dependents on each other?
A : Tight Coupling
B : Cohesion
C : Loose Coupling
D : High Coupling
Q.no 60. In which process, a local variable has the same name as one of the instance variables?
A : Serialization
B : Variable Shadowing
C : Abstraction
D : Multi-threading
https://sppu.wheebox.com/WAC-3/openanswers.obj 49/4
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 1. Which of this method of class StringBuffer is used to concatenate the string
representation to the end of invoking string?
A : concat()
B : append()
C : join()
D : concatenate()
A : drawString( )
B : display( )
C : print( )
D : transient( )
Q.no 3. Which are passive controls that do not support any interaction with the user?
A : Choice
B : List
C : Checkbox
D : Labels
A : try
B : catch
C : thrown
D : finaly
Q.no 5. Which method is called only once during the run time of your applet?
A : stop()
B : paint()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 50/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : destroy()
D : init()
Q.no 6. Which is used to store data and partial results, as well as to perform dynamic linking,
return values for methods, and dispatch exceptions?
A : Window
B : Panel
C : Frame
D : Container
A:7
B:4
C:9
D:8
B : An html file
C : Both A & B
A : Class
B : Interface
C : Abstract class
D : Other
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 51/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 11. Which is a component in AWT that can contain another component like buttons, text
fields, labels etc.?
A : Window
B : Container
C : Panel
D : Frame
A : Button
B : Label
C : FlowLayout
D : TextField
Q.no 13. Which of the following is method of wrapper Integer for converting the value of an
object into int?
A : bytevalue()
B : int intValue();
C : Bytevalue()
D : Byte Bytevalue()
Q.no 14. Which of the following is true about interfaces in java? Consider an interface that
has 5 methods in it.
A : A class can implement few methods which is required for the class.
B : The class must implement all the five methods.
C : The class must not implement the five methods.
A : only a
B : only b
C : only c
Q.no 16. which of the following is true about methods in an interface in java?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 52/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Private and protected access modifiers can also be used to declare methods in interface
A : A,B &C
B : A,B,C & D
C : B, C & D
D : A,C &D
A : class
B : interface
C : implements
D : abstract
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 53/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : only a
B : only b
C : only c
A : Same class
B : Other class
C : Anonymous class
Q.no 23. Which of these method of Object class can generate duplicate copy of the object on
which it is called?
A : clone()
B : copy()
C : duplicate()
D : dito()
A : getStatus( )
B : getState( )
C : isChecked( )
D : getChecked( )
Q.no 26. What is the name of a stream that connects two running programs?
B : Processing stream.
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 54/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Pipe
D : Channel
Q.no 27. Which is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
A : Window
B : container
C : Panel
D : Frame
Q.no 28. Which applet java.awt.component class provides the life cycle method?
Q.no 29. Which method is first Called for any applet when it starts its execution?
A : void destroy()
B : void start()
C : void init()
D : boolean isActive()
Q.no 30. Which of these methods can be used to output a string in an applet?
A : display()
B : print()
C : drawString()
D : transient()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 55/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 32. Button Control implements following listener interface.
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
Q.no 33. Which class provides many methods for graphics programming?
A : java.awt
B : java.Graphics
C : ava.awt.Graphics
D : Both A & B
Q.no 35. Which of these class encapsulate the runtime state of an object or an interface?
A : Class
B : Object
C : Runtime
D : System
Q.no 36. MouseEvent is subclass of which of the following class?
A : ComponentEvent
B : ContainerEvent
C : ItemEvent
D : InputEvent
Q.no 37. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 56/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Browser
Q.no 38. Which of these class is related to all the exceptions that are explicitly thrown?
A : Error
B : Exception
C : Throwable
D : Throw
Q.no 39. Which of the following methods can be used to draw the outline of a square within a
java.awt.Component object?
(A) fillRect()
(B) drawLine()
(C) drawRect()
(D) drawString()
(E) drawPolygon()
Q.no 40. Which of these values are returns under the case of normal termination of a
program?
A:0
B:1
C:2
D:3
A : ArithmeticException
B : ClassNotFoundException
C : NullPointerException
D : NumberFormatException
A : only a
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 57/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : only b
C : only c
Q.no 43. The Swing Component classes that are used in Encapsulates a mutually exclusive set
of buttons?
A : AbstractButto
B : ButtonGroup
C : JButton
D : ImageIcon
Q.no 44. Which of the following is true about AWT and Swing components.
C : Random order
D : LIFO order
Q.no 46. What is the value of “d” in the following Java code snippet? Double d = Math.round (
2.5 + Math.random() );
A:2
B:3
C:4
D : 2.5
Q.no 47. Can data flow through a given stream in both directions?
C: Yes; but only one direction at a time. Yes; but only one direction at a time. Yes; but only one
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 58/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
direction at a time.
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
Q.no 48. Which of these class contains only floating point functions?
A : Math
B : Process
C : System
D : Object
Q.no 49. Which of these class is used to read from byte array?
A : InputStream
B : BufferedInputStream
C : ArrayInputStream
D : ByteArrayInputStream
Q.no 50. Which of these modifiers can be used for a variable so that it can be accessed from
any thread or parts of a program?
A : transient
B : volatile
C : global
D : No modifier is needed
Q.no 51. Which of the following is true about the anonymous inner class?
Q.no 52. Which of these methods can be used to change location of an event?
A : ChangePoint()
B : TranslatePoint()
C : ChangeCordinates()
D : TranslateCordinates()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 59/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 53. Which of these methods is used to write() into a file?
A : put()
B : putFile()
C : write()
D : writeFile()
Q.no 54. Which of these methods are used to register a mouse motion listener?
A : addMouse()
B : addMouseListener()
C : addMouseMotionListner()
D : eventMouseMotionListener()
Q.no 56. In which process, a local variable has the same name as one of the instance variables?
A : Serialization
B : Variable Shadowing
C : Abstraction
D : Multi-threading
Q.no 58. If you want to assign a value of 88 to the variable year, then which of the following
lines can be used within an <applet> tag.
A : number = getParameter(88)
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 60/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : <number=99>
Q.no 59. What will be the output of the following Java program? class output
{
public static void main(String args[])
{
String s1 = "Hello"; String s2 = s1.replace('l','w'); System.out.println(s2);
}}
A : hello
B : helwo
C : hewwo
D : hewlo
Q.no 60. Which of these classes are the direct subclasses of the Throwable class?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 61/12
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : Graphical
B : user interactive
C : Both A & B
D : None of these
Q.no 2. hich of these methods of class String is used to check whether a given object starts
with a particular string literal?
A : startsWith()
B : endsWith()
C : Starts()
D : ends()
A : setText()
B : getText()
C : Both A & B
B : An html file
C : Both A & B
Q.no 5. Which of this method of class StringBuffer is used to concatenate the string
representation to the end of invoking string?
A : concat()
B : append()
C : join()
D : concatenate()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 62/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 6. What invokes immediately after the start() method and also any time the applet needs
to repaint itself in the browser?
A : stop()
B : init()
C : paint()
D : destroy()
Q.no 7. Which object can be constructed to show any number of choices in the visible
window?
A : Choice
B : Labels
C : List
D : choicebox
Q.no 8. Which of these method of class StringBuffer is used to find the length of current
character sequence?
A : Length()
B : length()
C : capacity()
D : Capacity()
A : drawString( )
B : display( )
C : print( )
D : transient( )
A : Exception Handling
B : String Handling
C : Event Handling
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 63/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 11. Which statement with respect to inner class is
true.
A. It is a way of logically grouping classes that are
only used in one place.
B. It increases encapsulation.
C. It can lead to more readable and maintainable
Code.
Q.no 12. Which of these class is used to read from byte array?
A : InputStream
B : BufferedInputStream
C : ArrayInputStream
D : ByteArrayInputStream
Q.no 13. Which of the following keyword is used by calling function to handle exception
thrown by called function?
A : throws
B : throw
C : try
D : catch
D : Both A & B
C : There can be only abstract methods in the interface not method body.
A : Component
B : Graphics
C : Container
D : Applet
A : final class
B : Object class
C : abstract class
D : child class
Q.no 18. Which of the following is a super class of all exception type classes?
A : Catchable
B : RuntimeExceptions
C : String
D : Throwable
Q.no 19. Which of these method of Object class can generate duplicate copy of the object on
which it is called?
A : clone()
B : copy()
C : duplicate()
D : dito()
Q.no 21. Can data flow through a given stream in both directions?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 65/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : No; a stream has one direction only, input or output.
C : Yes; but only one direction at a time. Yes; but only one direction at a time. Yes; but only one
direction at a time.
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
A : Button
B : Label
C : FlowLayout
D : TextField
Q.no 24. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
D : all of above
Q.no 25. Which of these operator is used to generate an instance of an exception than can be
thrown by using throw?
A : new
B : malloc
C : alloc
D : thrown
A : class
B : interface
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 66/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : implements
D : abstract
Q.no 27. Which of the following applet tags is legal to embed an applet class named Test into a
webpage?
B : <applet>
code=Test.class width=200 height=100>
</applet>
C : <applet
code=Test.class width=200 height=100>
</applet>
D : <applet
param=Test.class width=200 height=100>
</applet>
Q.no 28. Which is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
A : Window
B : container
C : Panel
D : Frame
Q.no 29. Which method is first Called for any applet when it starts its execution?
A : void destroy()
B : void start()
C : void init()
D : boolean isActive()
Q.no 30. Which is a component in AWT that can contain another component like buttons, text
fields, labels etc.?
A : Window
B : Container
C : Panel
D : Frame
B:6
C:7
D:8
C : replace() method replaces first occurrence of a character in invoking string with another
character
D : replace() method replaces last occurrence of a character in invoking string with another
character
Q.no 33. Which part of code gets executed whether exception is caught or not?
A : try
B : catch
C : throw
D : finally
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
Q.no 35. What is the name of a stream that connects two running programs?
B : Processing stream.
C : Pipe
D : Channel
Q.no 36. Which of the following handles the exception when a catch is not used?
A : finally
B : throw handler
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 68/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : default handler
Q.no 37. Which of these operators can be used to get run time information about an object?
A : getInfo
B : Info
C : instanceof
D : getinfoof
Q.no 38. Which one is correct declaration for implementing two interfaces? Consider,
Interface A and B. class C wants to implements both interfaces.
B : class C implements A, B
Q.no 41. What is the value of “d” in the following Java code snippet? Double d = Math.round (
2.5 + Math.random() );
A:2
B:3
C:4
D : 2.5
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 69/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 42. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
C : Browser
A : getStatus( )
B : getState( )
C : isChecked( )
D : getChecked( )
Q.no 44. When an applet begins, in which sequence will the AWT call the methods?
A : init(),paint(),start()
B : Start(),paint(),init()
C : paint(),start(),init()
D : intit(),start(),paint()
A : Both a & d
B : only b
C : a ,b, c & d
D : only a
C : "X extends Y" is correct if X and Y are either both classes or both interfaces
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 70/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
D : "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
Q.no 47. Which of these methods can be used to output a string in an applet?
A : display()
B : print()
C : drawString()
D : transient()
Q.no 48. Which of these functions is called to display the output of an applet?
A : display()
B : paint()
C : displayApplet()
D : PrintApplet()
A : VirtualMachineError
B : ThreadDeath
C : IOError
D : All of these
Q.no 50. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
A : substring()
B : Substring()
C : SubString()
D : sub()
A : String
B : Object
C : void
D : Function
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 71/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : Used for a whitespace character
Q.no 54. Which of the following is/are the possible values for alignment attribute of Applet
tag.
i) Top ii) Left iii) Middle iv) Baseline
A : Files.delete(path)
B : Files.deleteDir()
C : Directory.delete()
D : Directory.delete(path)
Q.no 56. Which of these points will be valid If superclass method does not throw any exception
D : All of these
Q.no 58. Which of these methods can be used to change location of an event?
A : ChangePoint()
B : TranslatePoint()
C : ChangeCordinates()
D : TranslateCordinates()
Q.no 59. Which of the following is true about the anonymous inner class?
Q.no 60. Which of these class is super class of all the events?
A : EventObject
B : EventClass
C : ActionEvent
D : ItemEvent
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 73/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : drawString( )
B : display( )
C : print( )
D : transient( )
Q.no 2. Which object can be constructed to show any number of choices in the visible
window?
A : Labels
B : Choice
C : List
D : Checkbox
A : Class
B : Interface
C : Abstract class
D : Other
Q.no 4. Which of the following classes can catch all exceptions which cannot be caught?
A : RuntimeException
B : Error
C : Exception
D : ParentException
Q.no 5. hich of these methods of class String is used to check whether a given object starts
with a particular string literal?
A : startsWith()
B : endsWith()
C : Starts()
D : ends()
Q.no 6. Which of these method of class String is used to compare two String objects for their
equality?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 74/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : equals()
B : Equals()
C : isequal()
D : Isequal()
Q.no 7. What invokes immediately after the start() method and also any time the applet needs
to repaint itself in the browser?
A : stop()
B : init()
C : paint()
D : destroy()
A:2
B:4
C:3
D:5
Q.no 9. Which method is called only once during the run time of your applet?
A : stop()
B : paint()
C : destroy()
D : init()
Q.no 10. When an applet is terminated which of the following sequence of methods calls take
place?
A : stop(),paint(),destroy()
B : destroy(),stop(),paint()
C : destroy(),stop()
D : stop(),destroy()
Q.no 11. Which class provides many methods for graphics programming?
A : java.awt
B : java.Graphics
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 75/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : ava.awt.Graphics
Q.no 12. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
A : substring()
B : Substring()
C : SubString()
D : sub()
Q.no 13. Can data flow through a given stream in both directions?
C : Yes; but only one direction at a time. Yes; but only one direction at a time. Yes; but only one
direction at a time.
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
Q.no 14. What is the name of a stream that connects two running programs?
B : Processing stream.
C : Pipe
D : Channel
Q.no 15. Which of the following applet tags is legal to embed an applet class named Test into a
webpage?
B : <applet>
code=Test.class width=200 height=100>
</applet>
C : <applet
code=Test.class width=200 height=100>
</applet>
D : <applet
param=Test.class width=200 height=100>
</applet>
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 76/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 16. Which of these class encapsulate the runtime state of an object or an interface?
A : Class
B : Object
C : Runtime
D : System
A : Button
B : Label
C : FlowLayout
D : TextField
Q.no 19. Which of the following handles the exception when a catch is not used?
A : finally
B : throw handler
C : default handler
Q.no 20. The Swing Component classes that are used in Encapsulates a mutually exclusive set
of buttons?
A : AbstractButto
B : ButtonGroup
C : JButton
D : ImageIcon
Q.no 21. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 77/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : Applet
C : Browser
Q.no 22. Which part of code gets executed whether exception is caught or not?
A : try
B : catch
C : throw
D : finally
Q.no 23. Which of these operator is used to generate an instance of an exception than can be
thrown by using throw?
A : new
B : malloc
C : alloc
D : thrown
A : Both a & d
B : only b
C : a ,b, c & d
D : only a
C : replace() method replaces first occurrence of a character in invoking string with another
character
D : replace() method replaces last occurrence of a character in invoking string with another
character
Q.no 26. Which of these class contains only floating point functions?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 78/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : Math
B : Process
C : System
D : Object
Q.no 27. Which of these functions is called to display the output of an applet?
A : display()
B : paint()
C : displayApplet()
D : PrintApplet()
C : "X extends Y" is correct if X and Y are either both classes or both interfaces
D : "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
Q.no 29. Which of the following methods can be used to draw the outline of a square within a
java.awt.Component object?
(A) fillRect()
(B) drawLine()
(C) drawRect()
(D) drawString()
(E) drawPolygon()
D : Both A & B
A : only a
B : only b
C : only c
Q.no 32. Which of these operators can be used to get run time information about an object?
A : getInfo
B : Info
C : instanceof
D : getinfoof
Q.no 33. Which of these class is used to read from byte array?
A : InputStream
B : BufferedInputStream
C : ArrayInputStream
D : ByteArrayInputStream
A : only a
B : only b
C : only c
Q.no 35. Which of the following is true about interfaces in java? Consider an interface that
has 5 methods in it.
A : A class can implement few methods which is required for the class.
A : bytevalue()
B : int intValue();
C : Bytevalue()
D : Byte Bytevalue()
A : class
B : interface
C : implements
D : abstract
Q.no 38. Which are the valid ways to create DataInputStream streams?
A : new DataInputStream();
Q.no 39. Which is the container that doesn't contain title bar and MenuBars but it can have
other components like button, textfield etc?
A : Window
B : Frame
C : Panel
D : Container
Q.no 40. Which of these method of Object class can generate duplicate copy of the object on
which it is called?
A : clone()
B : copy()
C : duplicate()
D : dito()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 81/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A:5
B:6
C:7
D:8
A : final class
B : Object class
C : abstract class
D : child class
Q.no 43. Which method is first Called for any applet when it starts its execution?
A : void destroy()
B : void start()
C : void init()
D : boolean isActive()
Q.no 44. When an applet begins, in which sequence will the AWT call the methods?
A : init(),paint(),start()
B : Start(),paint(),init()
C : paint(),start(),init()
D : intit(),start(),paint()
Q.no 45. Which of these methods can be used to output a string in an applet?
A : display()
B : print()
C : drawString()
D : transient()
A : ArithmeticException
B : ClassNotFoundException
C : NullPointerException
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 82/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
D : NumberFormatException
Q.no 48. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
D : all of above
Q.no 49. Which of the following methods can be used to remove a java.awt.Component object
from the display?
A : remove()
B : hide()
C : disappear()
D : delete()
Q.no 50. Which is the correct way to inherit and implement the interface? Consider and
example, Interface is IAnimal and a class is Cat that wants to implement interface.
A : String
B : Object
C : void
D : Function
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 83/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 52. In which process, a local variable has the same name as one of the instance variables?
A : Serialization
B : Variable Shadowing
C : Abstraction
D : Multi-threading
Q.no 53. What is it called where object has its own lifecycle and child object cannot belong to
another parent object?
A : Aggregation
B : Composition
C : Encapsulation
D : Association
Q.no 54. To use the ActionListener interface it must be implemented by a class there are
several ways to do that find in the following?
A. Creating a new class B. Using the class the graphical component C. An anonymous inner
class
A:A&B
B:A&c
C : A,B & C
D:B&C
A : createLink()
B : createSymLink()
C : createSymbolicLink()
D : createTempLink()
Q.no 57. What is the output of the following program code? Abstract class C1{
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 84/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
public C1(){
System.out.print(1);
}
}
class C2 extends C1{
public C2(){
System.out.print(2);
}
}
class C3 extends C2{
public C3(){
System.out.println(3);
}
}
public class Test{
public static void main(String[] a){
new C3();
}
}
A : 12
B : 23
C : 123
D : 321
Q.no 58. The .......................... attribute of applet tag specifies the amount of horizontal blank
space the browser should leave surrounding the applet.
A : SPACE=pixels
B : HSPACE=piexls
C : HWIDTH=piexls
D : HBLANK=pixels
Q.no 59. Which of these methods can be used to determine the type of event?
A : getSource()
B : getId()
C : getEvent()
D : getEventObject()
Q.no 60. FileInputStream implements which interface for closing file automatically in java7?
A : java.lang.AutoClose
B : java.lang.CloseAutomatically
C : java.lang.AutoCloseable
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 85/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
D : java.lang.Closeable
A : AWT
B : Swing
C : Both A & B
Q.no 2. When an applet is terminated which of the following sequence of methods calls take
place?
A : stop(),paint(),destroy()
B : destroy(),stop(),paint()
C : destroy(),stop()
D : stop(),destroy()
B:4
C:3
D:5
Q.no 4. Which are passive controls that do not support any interaction with the user?
A : Choice
B : List
C : Checkbox
D : Labels
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 86/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : Banner using Applet
B : Basic Applet
C : Display clock
B : An html file
C : Both A & B
Q.no 7. Which method is called only once during the run time of your applet?
A : stop()
B : paint()
C : destroy()
D : init()
A : try
B : catch
C : throw
D : finaly
Q.no 9. Which of these keywords must be used to handle the exception thrown by try block in
some rational manner?
A : try
B : catch
C : throw
D : finaly
Q.no 10. hich of these methods of class String is used to check whether a given object starts
with a particular string literal?
A : startsWith()
B : endsWith()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 87/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Starts()
D : ends()
Q.no 11. The Swing Component classes that are used in Encapsulates a mutually exclusive set
of buttons?
A : AbstractButto
B : ButtonGroup
C : JButton
D : ImageIcon
C : There can be only abstract methods in the interface not method body.
B : Label
C : FlowLayout
D : TextField
Q.no 14. Which of these methods can be used to output a string in an applet?
A : display()
B : print()
C : drawString()
D : transient()
Q.no 16. Which of these class is related to all the exceptions that are explicitly thrown?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 88/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : Error
B : Exception
C : Throwable
D : Throw
Q.no 17. Which of the following is a super class of all exception type classes?
A : Catchable
B : RuntimeExceptions
C : String
D : Throwable
A : VirtualMachineError
B : ThreadDeath
C : IOError
D : All of these
Q.no 19. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
D : all of above
Q.no 20. Which of these operator is used to generate an instance of an exception than can be
thrown by using throw?
A : new
B : malloc
C : alloc
D : thrown
Q.no 21. Which class provides many methods for graphics programming?
A : java.awt
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 89/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : java.Graphics
C : ava.awt.Graphics
C : replace() method replaces first occurrence of a character in invoking string with another
character
D : replace() method replaces last occurrence of a character in invoking string with another
character
A : getStatus( )
B : getState( )
C : isChecked( )
D : getChecked( )
Q.no 24. Which of the following methods can be used to remove a java.awt.Component object
from the display?
A : remove()
B : hide()
C : disappear()
D : delete()
Q.no 25. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
C : Browser
Q.no 26. Which of these values are returns under the case of normal termination of a
program?
A:0
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 90/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B:1
C:2
D:3
Q.no 27. Which one is correct declaration for implementing two interfaces? Consider,
Interface A and B. class C wants to implements both interfaces.
B : class C implements A, B
A : Both a & d
B : only b
C : a ,b, c & d
D : only a
Q.no 30. Which are the valid ways to create DataInputStream streams?
A : new DataInputStream();
Q.no 31. Which of these exceptions handles the divide by zero error?
A : ArithmeticException
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 91/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : MathException
C : IllegalAccessException
D : IllegarException
Q.no 32. Which of the following methods can be used to change the size of a
java.awt.Component object?
(A) dimension()
(B) setSize()
(C) area()
(D) size()
(E) resize()
Q.no 33. Which of these method of Object class can generate duplicate copy of the object on
which it is called?
A : clone()
B : copy()
C : duplicate()
D : dito()
Q.no 34. which of the following is true about methods in an interface in java?
C : Private and protected access modifiers can also be used to declare methods in interface
Q.no 35. What is the value of “d” in the following Java code snippet? Double d = Math.round (
2.5 + Math.random() );
A:2
B:3
C:4
D : 2.5
Q.no 36. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 92/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : substring()
B : Substring()
C : SubString()
D : sub()
A:5
B:6
C:7
D:8
Q.no 38. Which of these operators can be used to get run time information about an object?
A : getInfo
B : Info
C : instanceof
D : getinfoof
A : Same class
B : Other class
C : Anonymous class
Q.no 40. Which of the following is true about AWT and Swing components.
Q.no 42. What is the name of a stream that connects two running programs?
B : Processing stream.
C : Pipe
D : Channel
Q.no 44. Which of these class contains only floating point functions?
A : Math
B : Process
C : System
D : Object
A : ArithmeticException
B : ClassNotFoundException
C : NullPointerException
D : NumberFormatException
Q.no 46. Which part of code gets executed whether exception is caught or not?
A : try
B : catch
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 94/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : throw
D : finally
Q.no 47. Which of the following is true about interfaces in java? Consider an interface that
has 5 methods in it.
A : A class can implement few methods which is required for the class.
A : only a
B : only b
C : only c
A : ComponentEvent
B : ContainerEvent
C : ItemEvent
D : InputEvent
A : only a
B : only b
C : only c
A : createLink()
B : createSymLink()
C : createSymbolicLink()
D : createTempLink()
Q.no 53. Which package provides many event classes and Listener interfaces for event
handling?
A : java.awt
B : ava.awt.Graphics
C : java.awt.event
Q.no 54. Name the class used to represent a GUI application window, which is optionally
resizable and can have a title bar, an icon, and menus.
A : Window
B : Panel
C : Dialog
D : Frame
Q.no 55. Which of these events will be generated if we close an applet’s window?
A : ActionEvent
B : ComponentEvent
C : AdjustmentEvent
D : WindowEvent
A : EventObject
B : EventClass
C : ActionEvent
D : ItemEvent
Q.no 58. Which of these methods can be used to change location of an event?
A : ChangePoint()
B : TranslatePoint()
C : ChangeCordinates()
D : TranslateCordinates()
Q.no 59. Which of the following is/are the possible values for alignment attribute of Applet
tag.
i) Top ii) Left iii) Middle iv) Baseline
Q.no 60. What is it called where object has its own lifecycle and child object cannot belong to
another parent object?
A : Aggregation
B : Composition
C : Encapsulation
D : Association
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 97/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 1. Which of these method of class String is used to compare two String objects for their
equality?
A : equals()
B : Equals()
C : isequal()
D : Isequal()
A : try
B : catch
C : throw
D : finaly
Q.no 3. What invokes immediately after the start() method and also any time the applet needs
to repaint itself in the browser?
A : stop()
B : init()
C : paint()
D : destroy()
Q.no 4. Which is used to store data and partial results, as well as to perform dynamic linking,
return values for methods, and dispatch exceptions?
A : Window
B : Panel
C : Frame
D : Container
Q.no 5. Which of these keywords must be used to handle the exception thrown by try block in
some rational manner?
A : try
B : catch
C : throw
D : finaly
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 98/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 6. When an applet is terminated which of the following sequence of methods calls take
place?
A : stop(),paint(),destroy()
B : destroy(),stop(),paint()
C : destroy(),stop()
D : stop(),destroy()
Q.no 7. Which object can be constructed to show any number of choices in the visible
window?
A : Choice
B : Labels
C : List
D : choicebox
Q.no 8. Which of the following classes can catch all exceptions which cannot be caught?
A : RuntimeException
B : Error
C : Exception
D : ParentException
Q.no 9. Which of this method of class StringBuffer is used to concatenate the string
representation to the end of invoking string?
A : concat()
B : append()
C : join()
D : concatenate()
B : An html file
C : Both A & B
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 99/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : A,B &C
B : A,B,C & D
C : B, C & D
D : A,C &D
Q.no 13. Which of these functions is called to display the output of an applet?
A : display()
B : paint()
C : displayApplet()
D : PrintApplet()
Q.no 14. Which of these operator is used to generate an instance of an exception than can be
thrown by using throw?
A : new
B : malloc
C : alloc
D : thrown
Q.no 15. Can data flow through a given stream in both directions?
C : Yes; but only one direction at a time. Yes; but only one direction at a time. Yes; but only one
direction at a time.
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 100/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : Both a & d
B : only b
C : a ,b, c & d
D : only a
A : ComponentEvent
B : ContainerEvent
C : ItemEvent
D : InputEvent
Q.no 18. What is the value of “d” in the following Java code snippet? Double d = Math.round (
2.5 + Math.random() );
A:2
B:3
C:4
D : 2.5
Q.no 19. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
A : substring()
B : Substring()
C : SubString()
D : sub()
Q.no 20. When an applet begins, in which sequence will the AWT call the methods?
A : init(),paint(),start()
B : Start(),paint(),init()
C : paint(),start(),init()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 101/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
D : intit(),start(),paint()
Q.no 21. Which of the following applet tags is legal to embed an applet class named Test into a
webpage?
B : <applet>
code=Test.class width=200 height=100>
</applet>
C : <applet
code=Test.class width=200 height=100>
</applet>
D : <applet
param=Test.class width=200 height=100>
</applet>
Q.no 22. Which of the following is true about AWT and Swing components.
A : class
B : interface
C : implements
D : abstract
Q.no 24. Which of the following handles the exception when a catch is not used?
A : finally
B : throw handler
C : default handler
Q.no 25. What will be the output of the following Java program? class A
{ int i; }
class B extends A
{ int j;
void display()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 102/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
{
super.i = j + 1;
System.out.println(j + " " + i);
}}
class inheritance {
public static void main(String args[])
{
B obj = new B();
obj.i=1; obj.j=2;
obj.display(); } }
A:22
B:33
C:23
D:32
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
Q.no 27. Which part of code gets executed whether exception is caught or not?
A : try
B : catch
C : throw
D : finally
Q.no 28. Which applet java.awt.component class provides the life cycle method?
Q.no 29. Which is a special type of program that is embedded in the webpage to generate the
dynamic content?
A : Package
B : Applet
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 103/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Browser
Q.no 30. The Swing Component classes that are used in Encapsulates a mutually exclusive set
of buttons?
A : AbstractButto
B : ButtonGroup
C : JButton
D : ImageIcon
C : replace() method replaces first occurrence of a character in invoking string with another
character
D : replace() method replaces last occurrence of a character in invoking string with another
character
A : only a
B : only b
C : only c
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 104/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : There can be only abstract methods in the interface not method body.
Q.no 35. Which of these exceptions handles the divide by zero error?
A : ArithmeticException
B : MathException
C : IllegalAccessException
D : IllegarException
A : only a
B : only b
C : only c
Q.no 37. What is the name of a stream that connects two running programs?
B : Processing stream.
C : Pipe
D : Channel
Q.no 38. The ActionListener interface is used for handling action events,For example,it's used
by a
A : JButton
B : JCheckbox
C : JMenuItem
D : all of above
Q.no 39. Which of the following methods can be used to change the size of a
java.awt.Component object?
(A) dimension()
(B) setSize()
(C) area()
(D) size()
(E) resize()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 105/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : (A), (B) & (E)
Q.no 40. Which of the following is method of wrapper Integer for converting the value of an
object into int?
A : bytevalue()
B : int intValue();
C : Bytevalue()
D : Byte Bytevalue()
A : getStatus( )
B : getState( )
C : isChecked( )
D : getChecked( )
Q.no 42. Which class provides many methods for graphics programming?
A : java.awt
B : java.Graphics
C : ava.awt.Graphics
Q.no 43. Which of the following is true about interfaces in java? Consider an interface that
has 5 methods in it.
A : A class can implement few methods which is required for the class.
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 106/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Abstract methods(unimplemented) and implemented methods both
Q.no 45. Which of these modifiers can be used for a variable so that it can be accessed from
any thread or parts of a program?
A : transient
B : volatile
C : global
D : No modifier is needed
A : VirtualMachineError
B : ThreadDeath
C : IOError
D : All of these
Q.no 47. Which is the correct way to inherit and implement the interface? Consider and
example, Interface is IAnimal and a class is Cat that wants to implement interface.
Q.no 48. Which of the following keyword is used by calling function to handle exception
thrown by called function?
A : throws
B : throw
C : try
D : catch
Q.no 49. which of the following is true about methods in an interface in java?
C : Private and protected access modifiers can also be used to declare methods in interface
C : Random order
D : LIFO order
Q.no 51. What will s2 contain after following lines of Java code? String s1 = "one"; String s2 =
s1.concat("two")
A : one
B : two
C : onetwo
D : twoone
Q.no 52. Which of these classes are the direct subclasses of the Throwable class?
Q.no 53. To use the ActionListener interface it must be implemented by a class there are
several ways to do that find in the following?
A. Creating a new class B. Using the class the graphical component C. An anonymous inner
class
A:A&B
B:A&c
C : A,B & C
D:B&C
A : Files.delete(path)
B : Files.deleteDir()
C : Directory.delete()
D : Directory.delete(path)
Q.no 55. The .......................... attribute of applet tag specifies the amount of horizontal blank
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 108/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
space the browser should leave surrounding the applet.
A : SPACE=pixels
B : HSPACE=piexls
C : HWIDTH=piexls
D : HBLANK=pixels
Q.no 56. What is the output of the following program code? Abstract class C1{
public C1(){
System.out.print(1);
}
}
class C2 extends C1{
public C2(){
System.out.print(2);
}
}
class C3 extends C2{
public C3(){
System.out.println(3);
}
}
public class Test{
public static void main(String[] a){
new C3();
}
}
A : 12
B : 23
C : 123
D : 321
Q.no 57. Arrange the steps involved in developing and testing the applet in correct order.
i) creating an executable applet (.classfile)
ii) preparing <APPLET> tag
iii) creating HTML file
iv) building an applet code (.java file)
v) testing the applet code
Q.no 58. Which of these methods can be used to determine the type of event?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 109/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : getSource()
B : getId()
C : getEvent()
D : getEventObject()
A : java.util package
B : java.lang package
C : java.awt package
D : java.io package
A : try
B : catch
C : thrown
D : finaly
A : String()
B : String(void)
C : String(0)
D : new String()
Q.no 3. Which are passive controls that do not support any interaction with the user?
A : Choice
B : List
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 110/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Checkbox
D : Labels
B : Basic Applet
C : Display clock
A : Graphical
B : user interactive
C : Both A & B
D : None of these
A : setText()
B : getText()
C : Both A & B
Q.no 7. Which of the following classes can catch all exceptions which cannot be caught?
A : RuntimeException
B : Error
C : Exception
D : ParentException
Q.no 8. Which object can be constructed to show any number of choices in the visible
window?
A : Labels
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 111/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
B : Choice
C : List
D : Checkbox
Q.no 9. Which of these method of class StringBuffer is used to find the length of current
character sequence?
A : Length()
B : length()
C : capacity()
D : Capacity()
Q.no 10. hich of these methods of class String is used to check whether a given object starts
with a particular string literal?
A : startsWith()
B : endsWith()
C : Starts()
D : ends()
Q.no 11. Which of the following methods can be used to remove a java.awt.Component object
from the display?
A : remove()
B : hide()
C : disappear()
D : delete()
Q.no 12. Which of these modifiers can be used for a variable so that it can be accessed from
any thread or parts of a program?
A : transient
B : volatile
C : global
D : No modifier is needed
A : VirtualMachineError
B : ThreadDeath
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 112/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : IOError
D : All of these
Q.no 14. Which are the valid ways to create DataInputStream streams?
A : new DataInputStream();
A : class
B : interface
C : implements
D : abstract
Q.no 16. Which of these class contains only floating point functions?
A : Math
B : Process
C : System
D : Object
Q.no 17. Which of these class encapsulate the runtime state of an object or an interface?
A : Class
B : Object
C : Runtime
D : System
A : only a
B : only b
C : only c
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 113/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 19. Which is the container that doesn't contain title bar and MenuBars but it can have
other components like button, textfield etc?
A : Window
B : Frame
C : Panel
D : Container
C : replace() method replaces first occurrence of a character in invoking string with another
character
D : replace() method replaces last occurrence of a character in invoking string with another
character
A : A,B &C
B : A,B,C & D
C : B, C & D
D : A,C &D
A : ItemListener
B : ActionListener
C : FlowListener
D : Adapter
C : "X extends Y" is correct if X and Y are either both classes or both interfaces
D : "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 114/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : only a
B : only b
C : only c
Q.no 25. What will be the output of the following Java program? class A
{ int i; }
class B extends A
{ int j;
void display()
{
super.i = j + 1;
System.out.println(j + " " + i);
}}
class inheritance {
public static void main(String args[])
{
B obj = new B();
obj.i=1; obj.j=2;
obj.display(); } }
A:22
B:33
C:23
D:32
Q.no 26. The Swing Component classes that are used in Encapsulates a mutually exclusive set
of buttons?
A : AbstractButto
B : ButtonGroup
C : JButton
D : ImageIcon
Q.no 27. Which of these functions is called to display the output of an applet?
A : display()
B : paint()
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 115/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : displayApplet()
D : PrintApplet()
Q.no 28. Which of the following keyword is used by calling function to handle exception
thrown by called function?
A : throws
B : throw
C : try
D : catch
A : final class
B : Object class
C : abstract class
D : child class
Q.no 30. Which of these class is used to read from byte array?
A : InputStream
B : BufferedInputStream
C : ArrayInputStream
D : ByteArrayInputStream
C : Random order
D : LIFO order
Q.no 32. Which class provides many methods for graphics programming?
A : java.awt
B : java.Graphics
C : ava.awt.Graphics
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 116/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : Button
B : Label
C : FlowLayout
D : TextField
Q.no 34. Which applet java.awt.component class provides the life cycle method?
D : Both A & B
A : ArithmeticException
B : ClassNotFoundException
C : NullPointerException
D : NumberFormatException
A : Same class
B : Other class
C : Anonymous class
Q.no 38. Which of these class is related to all the exceptions that are explicitly thrown?
A : Error
B : Exception
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 117/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Throwable
D : Throw
Q.no 39. Which of these methods of class StringBuffer is used to extract a substring from a
String object?
A : substring()
B : Substring()
C : SubString()
D : sub()
C : There can be only abstract methods in the interface not method body.
Q.no 41. Which of these methods can be used to output a string in an applet?
A : display()
B : print()
C : drawString()
D : transient()
Q.no 43. Can data flow through a given stream in both directions?
C : Yes; but only one direction at a time. Yes; but only one direction at a time. Yes; but only one
direction at a time.
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 118/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
D : Yes; only one stream is needed to read and write a file Yes; only one stream is needed to read
and write a file Yes; only one stream is needed to read and write a file
Q.no 44. Which of the following is a super class of all exception type classes?
A : Catchable
B : RuntimeExceptions
C : String
D : Throwable
Q.no 45. Which of these exceptions handles the divide by zero error?
A : ArithmeticException
B : MathException
C : IllegalAccessException
D : IllegarException
Q.no 46. Which one is correct declaration for implementing two interfaces? Consider,
Interface A and B. class C wants to implements both interfaces.
B : class C implements A, B
Q.no 49. Which of the following handles the exception when a catch is not used?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 119/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : finally
B : throw handler
C : default handler
Q.no 50. Which is the correct way to inherit and implement the interface? Consider and
example, Interface is IAnimal and a class is Cat that wants to implement interface.
Q.no 51. Arrange the steps involved in developing and testing the applet in correct order.
i) creating an executable applet (.classfile)
ii) preparing <APPLET> tag
iii) creating HTML file
iv) building an applet code (.java file)
v) testing the applet code
Q.no 54. Which of these class is super class of all the events?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 120/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
A : EventObject
B : EventClass
C : ActionEvent
D : ItemEvent
Q.no 55. Which of these events will be notified if scroll bar is manipulated?
A : ActionEvent
B : ComponentEvent
C : AdjustmentEvent
D : WindowEvent
A : Files.delete(path)
B : Files.deleteDir()
C : Directory.delete()
D : Directory.delete(path)
Q.no 57. What is it called if an object has its own lifecycle and there is no owner?
A : Aggregation
B : Composition
C : Encapsulation
D : Association
Q.no 58. The .......................... attribute of applet tag specifies the amount of horizontal blank
space the browser should leave surrounding the applet.
A : SPACE=pixels
B : HSPACE=piexls
C : HWIDTH=piexls
D : HBLANK=pixels
Q.no 59. Which of the following is true about the anonymous inner class?
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 121/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 60. What will s2 contain after following lines of Java code? String s1 = "one"; String s2 =
s1.concat("two")
A : one
B : two
C : onetwo
D : twoone
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 1/13