You are on page 1of 123

SPPU All Course MCQ

All MCQ PDF Format MBA / BE /BA /ENGIEENARING /


BSC /MSC /BCA/ BCOM

Join Telegram Channel :- Click here to


(This Channel Provides PDF For Educational Purpose,
So Please Don’t Abuse Any PDF Also Don’t Sell Them).

या फोटोवर क्लिक करा


Telegram Another Channel
मराठी पुस्तके ला जॉईन करा (Ebook Marathi / English / Hindi )

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.

2) Attempt any 50 questions out of 60.

3) Use of calculator is allowed.

4) Each question carries 1 Mark.

5) Specially abled students are allowed 20 minutes extra for examination.

6) Do not use pencils to darken answer.

7) Use only black/blue ball point pen to darken the appropriate circle.

8) No change will be allowed once the answer is marked on OMR Sheet.

9) Rough work shall not be done on OMR sheet or on question paper.

10) Darken ONLY ONE CIRCLE for each answer.

Q.no 1. Which method is used to set the graphics current color to the specified color in the
graphics class?

A : public abstract void Color(Color C)

B : public abstract void setColor(Color c)

C : public abstract void drawString(String str, int x, int y)

D : public abstract void Color()

Q.no 2. What is used to run an Applet?

A : An AppletViewer tool(for testing purpose)

B : An html file

C : Both A & B

D : None of the above

Q.no 3. Give the abbreviation of AWT?

A : Applet Windowing Toolkit

B : Abstract Windowing Toolkit

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

C : Absolute Windowing Toolkit

D : Absolute Windowing Tools

Q.no 4. Which are passive controls that do not support any interaction with the user?

A : Choice

B : List

C : Checkbox

D : Labels

Q.no 5. Exception is a class/interface/abstract class/other?

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

Q.no 8. Which of these keywords is not a part of exception handling?

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

Q.no 11. Which AWT component is not editable?

A : Button

B : Label

C : FlowLayout

D : TextField

Q.no 12. Which method is used to check the status of checkbox?

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.

B : The class must implement all the five methods.

C : The class must not implement the five methods.

D : The class can extends few methods.

Q.no 14. When comparing java.io.BufferedWriter and java.io.FileWriter, which capability


exist as a method in only one of two ?

A : closing the stream


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 3/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1

B : flushing the stream

C : writting to the stream

D : writting a line separator to the stream

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

Q.no 18. Button Control implements following listener interface.

A : ItemListener

B : ActionListener

C : FlowListener

D : Adapter

Q.no 19. Which of the following statement is correct?

A : reverse() method reverses all characters

B : reverseall() method reverses all characters

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

Q.no 20. Which are the common security restrictions in applets?

A : Applets can't load libraries or define native methods

B : An applet can't read every system property

C : Applets can play sounds

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

Q.no 22. Which class cannot be sub classed?

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.

A : class C implements A, implements B

B : class C implements A, B

C : class C implements A extends B

D : class C extends A extends 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?

A : <applet class=Test width=200 height=100> </applet>

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

Q.no 28. What is subclass in java?

A : A subclass is a class that extends another class

B : A subclass is a class declared inside a class

C : A subclass is a class declared outside a class

D : A subclass is a class declare inside a interface

Q.no 29. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )

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()

A : (B), (C) & (E)

B : C), (D) & (E)

C : (A), (B), (C) & (E)

D : A), (B) & (C)

Q.no 31. which of the following is true about methods in an interface in java?

A : An interface can contain only abstract method.

B : We can define a method in an interface

C : Private and protected access modifiers can also be used to declare methods in interface

D : We can define a constuctor in an interface

Q.no 32. The method places a Menu m into


the MenuBar mb.
(a) mb.addMenuItem(m)
(b) mb.addItem(m)
(c) mb.add(m)

A : only a

B : only b

C : only c

D : All the above

Q.no 33. Which of the following is true about AWT and Swing components.

A : AWT components creates a process where as swing components creates a thread

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

B : AWT components creates a thread where as swing components creates a process

C : Both AWT and Swing components creates a process

D : Both AWT and swing components creates a thread

Q.no 34. Which applet java.awt.component class provides the life cycle method?

A : public void paint(Graphics g)

B : public void destroy()

C : public void stop()

D : public void init()

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()

Q.no 37. What are the different types of controls in AWT?


A. Labels B. Pushbuttons C. Checkboxes D.Choice lists

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()

Q.no 39. Which keyword is used to declare an interface in java?

A : class

B : interface

C : implements

D : abstract

Q.no 40. False statement about Java interface

A : It is used to achieve abstraction and multiple inheritance in Java.

B : It can be instantiated, means, we can create an object of an interface.

C : There can be only abstract methods in the interface not method body.

D : Object of an interface cannot be created.

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 42. Which method is used to process mouse click?

A : public void mouseClicked(MouseListener m)

B : public void mouseIsClicked(MouseEvent m)

C : public void mouseClicked(MouseEvent m)

D : public void mouseClick(MouseEvent m)

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

Q.no 44. How many types of controls does AWT support?

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

D : None of the above

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

D : None of the above

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

Q.no 50. MouseEvent is subclass of which of the following class?

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 : RuntimeException and Error class

B : Exception and VirtualMachineError class

C : Error and Exception class

D : IOException and VirtualMachineError class

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. 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

Q.no 56. How can we delete all files in a directory?

A : Files.delete(path)

B : Files.deleteDir()

C : Directory.delete()

D : Directory.delete(path)

Q.no 57. What is a listener in context to event handling?

A : A listener is a variable that is notified when an event occurs

B : A listener is a object that is notified when an event occurs

C : A listener is a method that is notified when an event occurs

D : None of the above

Q.no 58. What is the use of \w in regex?

A : Used for a whitespace character

B : Used for a non-whitespace character

C : Used for a word character

D : Used for a non-word character

Q.no 59. What do you mean by nameless objects?

A : An object created by using the new keyword.

B : An object of a superclass created in the subclass.

C : An object without having any name but having a reference.

D : An object that has no reference.

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

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

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()

Q.no 2. The Following steps are required to perform

1) Implement the Listener interface and overrides its methods


2) Register the component with the Listener.

A : Exception Handling

B : String Handling

C : Event Handling

D : None of the above

Q.no 3. Which of the method can be used to output a String in an Applet?


A : drawString( )

B : display( )

C : print( )

D : transient( )

Q.no 4. Which method can set or change the text in a Label?

A : setText()

B : getText()

C : Both A & B

D : All the above

Q.no 5. Which method is used to set the graphics current color to the specified color in the
graphics class?

A : public abstract void Color(Color C)

B : public abstract void setColor(Color c)

C : public abstract void drawString(String str, int x, int y)

D : public abstract void Color()


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 14/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. Which of this method of class String is used to obtain a length of String object?

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()

Q.no 8. Which of these keywords is used to manually throw an exception?

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

Q.no 10. Which of these keywords is not a part of exception handling?

A : try

B : catch

C : thrown

D : finaly

Q.no 11. MouseEvent is subclass of which of the following class?

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?

A : public void paint(Graphics g)

B : public void destroy()

C : public void stop()

D : public void init()

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

D : None of the above

Q.no 16. Which of the following applet tags is legal to embed an applet class named Test into a
webpage?

A : <applet class=Test width=200 height=100> </applet>

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 17. MVC architecture is

A : Modelling – Visual – Controller

B : Model – View – Controller

C : Model – Viewable – Controller

D : Many – View – Controller

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?

A : An interface can contain only abstract method.

B : We can define a method in an interface

C : Private and protected access modifiers can also be used to declare methods in interface

D : We can define a constuctor in an 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

D : java run time system

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()

Q.no 22. Which method is used to check the status of checkbox?

A : getStatus( )

B : getState( )

C : isChecked( )

D : getChecked( )

Q.no 23. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )
(c) getSelectedIndex( )
(d) getItem( )

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();

B : new DataInputStream(new File("in.dat"));

C : new DataInputStream("in.dat", "r");

D : new DataInputStream(new FileInputStream("in.dat");

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

Q.no 26. 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.
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 18/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C. It can lead to more readable and maintainable
Code.

A : Only A statement is true

B : Only B statement is true.

C : Only C statement is true.

D : All A,B and C are true.

Q.no 27. Which keyword is used to declare an interface in java?

A : class

B : interface

C : implements

D : abstract

Q.no 28. Can data flow through a given stream in both directions?

A : No; streams only work for output.

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

Q.no 29. Which class cannot be sub classed?

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()

Q.no 33. Button Control implements following listener interface.

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()

A : (A), (B) & (E)

B : (A), (B), (C) & (E)

C : (B) & (E)

D : (D) & (E)

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()

A : (B), (C) & (E)

B : C), (D) & (E)

C : (A), (B), (C) & (E)

D : A), (B) & (C)

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

Q.no 45. What exception thrown by parseInt() method?

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

Q.no 47. The method places a Menu m into


the MenuBar mb.mb.addMenuItem(m)
(a) mb.addItem(m)
(b) mb.add(m)

A : only a

B : only b

C : only c

D : All the above

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

Q.no 49. What are the different types of controls in AWT?


A. Labels B. Pushbuttons C. Checkboxes D.Choice lists

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

A : n interface that defines methods to open files.

B : an abstract class defined in java.io.

C : an interface that defines methods to read primitive data types.

D : a class we can use to read primitive data types.

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

Q.no 52. An interface with no fields or methods is known as a .


A : CharSequence Interface

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

A : overridden method of subclass can throw any RuntimeException

B : overridden method of subclass cannot throw any checked exception


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 24/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : overridden method of subclass may 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()

Q.no 57. Which of these are integer constants of TextEvent class?

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 : It has only methods

B : Objects can't be created

C : It has a fixed class name

D : It has no class name

Q.no 59. Which of these methods is used to write() into a file?

A : put()

B : putFile()

C : write()

D : writeFile()

Q.no 60. What is the return type of lambda expression?

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 -

Q.no 1. Which of these constructors is used to create an empty String object?

A : String()

B : String(void)

C : String(0)

D : new String()

Q.no 2. Which of these class is superclass of String and StringBuffer class?

A : java.util

B : java.lang

C : ArrayList

D : None of the mentioned

Q.no 3. When does Exceptions in Java arises in code sequence?

A : Run Time

B : Compilation Time

C : Can Occur Any Time

D : Prepocessing

Q.no 4. Give the abbreviation of AWT?

A : Applet Windowing Toolkit

B : Abstract Windowing Toolkit

C : Absolute Windowing Toolkit

D : Absolute Windowing Tools

Q.no 5. The Following steps are required to perform

1) Implement the Listener interface and overrides its methods


2) Register the component with the Listener.

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()

Q.no 7. Which class is used for this Processing Method processActionEvent( )?

A : Button,List,MenuItem

B : Button,Checkbox,Choice

C : Scrollbar,Component,Button

D : None of the above

Q.no 8. Which method can set or change the text in a Label?

A : setText()

B : getText()

C : Both A & B

D : All the above

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

Q.no 12. Order of execution of constructors in Java Inheritance is

A : Base to derived class

B : Derived to base class

C : Random order

D : LIFO order

Q.no 13. A java interface can contain —

A : public static Final Variables only

B : public Abstract methods

C : Abstract methods(unimplemented) and implemented methods both

D : public static Final Variables and abstract methods both

Q.no 14. MVC architecture is


A : Modelling – Visual – Controller

B : Model – View – Controller

C : Model – Viewable – Controller

D : Many – View – Controller

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

Q.no 16. False statement about Java interface

A : It is used to achieve abstraction and multiple inheritance in Java.

B : It can be instantiated, means, we can create an object of an interface.

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.

Q.no 17. MouseEvent is subclass of which of the following class?

A : ComponentEvent

B : ContainerEvent

C : ItemEvent

D : InputEvent

Q.no 18. Which method is used to check the status of checkbox?

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 : AWT components creates a process where as swing components creates a thread

B : AWT components creates a thread where as swing components creates a process

C : Both AWT and Swing components creates a process

D : Both AWT and swing components creates a thread

Q.no 21. The is an object that is notified when an event occurs.


(a) Listener
(b) Sources
(c) Event

A : only a

B : only b

C : only c

D : All the above

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()

Q.no 25. Which of the following statement is correct?

A : reverse() method reverses all characters

B : reverseall() method reverses all characters

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. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )
(c) getSelectedIndex( )
(d) getItem( )

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?

A : An interface can contain only abstract method.

B : We can define a method in an interface

C : Private and protected access modifiers can also be used to declare methods in interface

D : We can define a constuctor in an 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?

A : Program stream Program stream Program stream

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()

Q.no 31. Which keyword is used to declare an interface in java?

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

Q.no 34. Where can the event handling code be written?

A : Same class

B : Other class

C : Anonymous class

D : All mentioned above

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

Q.no 36. What are the different types of controls in AWT?


A. Labels B. Pushbuttons C. Checkboxes D.Choice lists

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();

B : new DataInputStream(new File("in.dat"));

C : new DataInputStream("in.dat", "r");

D : new DataInputStream(new FileInputStream("in.dat");

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()

Q.no 41. The method places a Menu m into


the MenuBar mb.
(a) mb.addMenuItem(m)
(b) mb.addItem(m)
(c) mb.add(m)

A : only a

B : only b

C : only c

D : All the above

Q.no 42. What is subclass in java?

A : A subclass is a class that extends another class

B : A subclass is a class declared inside a class

C : A subclass is a class declared outside a class


https://sppu.wheebox.com/WAC-3/openanswers.obj 33/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj
D : A subclass is a class declare inside a interface

Q.no 43. Button Control implements following listener interface.

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?

A : No; streams only work for output.

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

Q.no 46. Which are the common security restrictions in applets?

A : Applets can't load libraries or define native methods

B : An applet can't read every system property

C : Applets can play sounds

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

D : None of the above


https://sppu.wheebox.com/WAC-3/openanswers.obj 34/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj

Q.no 48. Which one is correct declaration for implementing two interfaces? Consider,
Interface A and B. class C wants to implements both interfaces.

A : class C implements A, implements B

B : class C implements A, B

C : class C implements A extends B

D : class C extends A extends 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()

A : (A), (B) & (E)

B : (A), (B), (C) & (E)

C : (B) & (E)

D : (D) & (E)

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

A : 1-i, 2-ii, 3-iii, 4-iv, 5-v

B : 1-ii, 2-iii, 3-iv, 4-v, 5-i

C : 1-iv, 2-i, 3-ii, 4-iii, 5-v

D : 1-iii, 2-iv, 3-v, 4-i, 5-ii

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

B : Objects can't be created

C : It has a fixed class name

D : It has no class name

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

Q.no 54. What is the return type of lambda expression?


A : String

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

D : None of the above

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

A : i, ii and iii only

B : ii, iii and iv only

C : i, iii and iv only

D : All i, ii, iii and iv

Q.no 59. In Graphics class which method is used to draws a rectangle with the specified width
and height?

A : public void drawRect(int x, int y, int width, int height)


B : public abstract void fillRect(int x, int y, int width, int height)

C : public abstract void drawLine(int x1, int y1, int x2, int y2)

D : public abstract void drawOval(int x, int y, int width, int height)

Q.no 60. Which of these classes are the direct subclasses of the Throwable class?

A : RuntimeException and Error class

B : Exception and VirtualMachineError class

C : Error and Exception class

D : IOException and VirtualMachineError 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

Q.no 3. The following


a) It is lightweight.
b) It supports pluggable look and feel.
c) It follows MVC (Model View Controller) architecture
are the advantages of .
A : AWT

B : Swing

C : Both A & B

D : None of the above

Q.no 4. Which of these keywords is used to manually throw an exception?

A : try

B : catch

C : throw

D : finaly

Q.no 5. When does Exceptions in Java arises in code sequence?

A : Run Time

B : Compilation Time

C : Can Occur Any 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 6. Which of these is an incorrect statement?

A : String objects are immutable, they cannot be changed

B : String object can point to some other reference of String variable

C : StringBuffer class is used to store string in a buffer for later use

D : None of the mentioned

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

Q.no 9. Which class is used for this Processing Method processActionEvent( )?

A : Button,List,MenuItem

B : Button,Checkbox,Choice

C : Scrollbar,Component,Button

D : None of the above

Q.no 10. How many types of controls does AWT support?

A:7

B:4

C:9

D:8

Q.no 11. Which class cannot be sub classed?


https://sppu.wheebox.com/WAC-3/openanswers.obj 39/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj

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?

A : No; streams only work for output.

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

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

A : An interface can contain only abstract method.

B : We can define a method in an interface

C : Private and protected access modifiers can also be used to declare methods in interface

D : We can define a constuctor in an 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

D : None of the above

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()

Q.no 21. DataInput is

A : n interface that defines methods to open files.

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.

C : an interface that defines methods to read primitive data types.

D : a class we can use to read primitive data types.

Q.no 22. What are the different types of controls in AWT?


A. Labels B. Pushbuttons C. Checkboxes D.Choice lists

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.

B : The class must implement all the five methods.

C : The class must not implement the five methods.

D : The class can extends few methods.

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

D : java run time system

Q.no 29. When comparing java.io.BufferedWriter and java.io.FileWriter, which capability


exist as a method in only one of two ?

A : closing the stream

B : flushing the stream

C : writting to the stream

D : writting a line separator to the stream

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()

A : (A), (B) & (E)

B : (A), (B), (C) & (E)

C : (B) & (E)

D : (D) & (E)

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.

A : class C implements A, implements B

B : class C implements A, B

C : class C implements A extends B

D : class C extends A extends B

Q.no 34. Which of these class contains only floating point functions?

A : Math

B : Process

C : System

D : Object

Q.no 35. Which is true


https://sppu.wheebox.com/WAC-3/openanswers.obj 44/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj

A : "X extends Y" is correct if and only if X is a class and Y is an interface

B : "X extends Y" is correct if and only if X is an interface and Y is a class

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();

B : new DataInputStream(new File("in.dat"));

C : new DataInputStream("in.dat", "r");

D : new DataInputStream(new FileInputStream("in.dat");

Q.no 38. What is the name of a stream that connects two running programs?

A : Program stream Program stream Program stream

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

Q.no 41. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )
(c) getSelectedIndex( )
(d) getItem( )

A : Both a & d

B : only b

C : a ,b, c & d

D : only a

Q.no 42. What are the variables defined in Dimension?


(a) length and width
(b) height and width
(c) height and length

A : only a

B : only b

C : only c

D : All the above

Q.no 43. The is an object that is notified when an event occurs.


(a) Listener
(b) Sources
(c) Event

A : only a

B : only b

C : only c

D : All the above

Q.no 44. Which class provides many methods for graphics programming?

A : java.awt

B : java.Graphics

C : ava.awt.Graphics

D : None of the above

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 46. Which method is used to process mouse click?

A : public void mouseClicked(MouseListener m)

B : public void mouseIsClicked(MouseEvent m)

C : public void mouseClicked(MouseEvent m)

D : public void mouseClick(MouseEvent m)

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

Q.no 48. Button Control implements following listener interface.

A : ItemListener

B : ActionListener

C : FlowListener

D : Adapter

Q.no 49. Which AWT component is not editable?

A : Button

B : Label

C : FlowLayout

D : TextField

Q.no 50. What is subclass in java?

A : A subclass is a class that extends another class

B : A subclass is a class declared inside a class

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

D : A subclass is a class declare inside a interface

Q.no 51. Which of the following is true about the anonymous inner class?

A : It has only methods

B : Objects can't be created

C : It has a fixed class name

D : It has no class name

Q.no 52. What do you mean by nameless objects?

A : An object created by using the new keyword.

B : An object of a superclass created in the subclass.

C : An object without having any name but having a reference.

D : An object that has no reference.

Q.no 53. How can we create a symbolic link to file?

A : createLink()

B : createSymLink()

C : createSymbolicLink()

D : createTempLink()

Q.no 54. What do you mean by chained exceptions in Java?

A : Exceptions occurred by the VirtualMachineError

B : An exception caused by other exceptions

C : Exceptions occur in chains with discarding the debugging information

D : None of the above

Q.no 55. Which of these methods is used to write() into a file?

A : put()

B : putFile()

C : write()

D : writeFile()

Q.no 56. Which package contains the Random class?


https://sppu.wheebox.com/WAC-3/openanswers.obj 48/4
16/10/2020 https://sppu.wheebox.com/WAC-3/openanswers.obj

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?

A : public void drawRect(int x, int y, int width, int height)

B : public abstract void fillRect(int x, int y, int width, int height)

C : public abstract void drawLine(int x1, int y1, int x2, int y2)

D : public abstract void drawOval(int x, int y, int width, int height)

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()

Q.no 2. Which of the method can be used to output a String in an Applet?

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

Q.no 4. Which of these keywords is not a part of exception handling?

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

Q.no 7. Give the abbreviation of AWT?

A : Applet Windowing Toolkit

B : Abstract Windowing Toolkit

C : Absolute Windowing Toolkit

D : Absolute Windowing Tools

Q.no 8. How many types of controls does AWT support?

A:7

B:4

C:9

D:8

Q.no 9. What is used to run an Applet?

A : An AppletViewer tool(for testing purpose)

B : An html file

C : Both A & B

D : None of the above

Q.no 10. Exception is a class/interface/abstract class/other?

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

Q.no 12. Which AWT component is not editable?

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.

D : The class can extends few methods.

Q.no 15. The method places a Menu m into


the MenuBar mb.
(a) mb.addMenuItem(m)
(b) mb.addItem(m)
(c) mb.add(m)

A : only a

B : only b

C : only c

D : All the above

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

A : An interface can contain only abstract method.

B : We can define a method in an interface

C : Private and protected access modifiers can also be used to declare methods in interface

D : We can define a constuctor in an interface

Q.no 17. Which method is used to process mouse click?

A : public void mouseClicked(MouseListener m)

B : public void mouseIsClicked(MouseEvent m)

C : public void mouseClicked(MouseEvent m)

D : public void mouseClick(MouseEvent m)

Q.no 18. What are the different types of controls in AWT?


A. Labels B. Pushbuttons C. Checkboxes D.Choice lists

A : A,B &C

B : A,B,C & D

C : B, C & D

D : A,C &D

Q.no 19. DataInput is

A : n interface that defines methods to open files.

B : an abstract class defined in java.io.

C : an interface that defines methods to read primitive data types.

D : a class we can use to read primitive data types.

Q.no 20. Which keyword is used to declare an interface in java?

A : class

B : interface

C : implements

D : abstract

Q.no 21. The is an object that is notified when an event occurs.


(a) Listener
(b) Sources
(c) Event

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

D : All the above

Q.no 22. Where can the event handling code be written?

A : Same class

B : Other class

C : Anonymous class

D : All mentioned above

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()

Q.no 24. Which method is used to check the status of checkbox?

A : getStatus( )

B : getState( )

C : isChecked( )

D : getChecked( )

Q.no 25. When comparing java.io.BufferedWriter and java.io.FileWriter, which capability


exist as a method in only one of two ?

A : closing the stream

B : flushing the stream

C : writting to the stream

D : writting a line separator to the stream

Q.no 26. What is the name of a stream that connects two running programs?

A : Program stream Program stream Program stream

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?

A : public void paint(Graphics g)

B : public void destroy()

C : public void stop()

D : public void init()

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()

Q.no 31. A java interface can contain —

A : public static Final Variables only

B : public Abstract methods

C : Abstract methods(unimplemented) and implemented methods both

D : public static Final Variables and abstract methods both

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 : None of the above

Q.no 34. Which are the common security restrictions in applets?

A : Applets can't load libraries or define native methods

B : An applet can't read every system property

C : Applets can play sounds

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

D : None of the above

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()

A : (B), (C) & (E)

B : C), (D) & (E)

C : (A), (B), (C) & (E)

D : A), (B) & (C)

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

Q.no 41. What exception thrown by parseInt() method?

A : ArithmeticException

B : ClassNotFoundException

C : NullPointerException

D : NumberFormatException

Q.no 42. What are the variables defined in Dimension?


(a) length and width
(b) height and width
(c) height and length

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

D : All the above

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.

A : AWT components creates a process where as swing components creates a thread

B : AWT components creates a thread where as swing components creates a process

C : Both AWT and Swing components creates a process

D : Both AWT and swing components creates a thread

Q.no 45. Order of execution of constructors in Java Inheritance is

A : Base to derived class

B : Derived to base class

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?

A : No; streams only work for output.

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
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?

A : It has only methods

B : Objects can't be created

C : It has a fixed class name

D : It has no class name

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 55. What do you mean by chained exceptions in Java?

A : Exceptions occurred by the VirtualMachineError

B : An exception caused by other exceptions

C : Exceptions occur in chains with discarding the debugging information

D : None of the above

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 57. What is a listener in context to event handling?

A : A listener is a variable that is notified when an event occurs

B : A listener is a object that is notified when an event occurs

C : A listener is a method that is notified when an event occurs

D : None of the above

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>

C : <param = radius value=88>

D : <param name=number value=88>

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?

A : RuntimeException and Error class

B : Exception and VirtualMachineError class

C : Error and Exception class

D : IOException and VirtualMachineError 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

Q.no 1. Java Applets are used to create applications.

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()

Q.no 3. Which method can set or change the text in a Label?

A : setText()

B : getText()

C : Both A & B

D : All the above

Q.no 4. What is used to run an Applet?

A : An AppletViewer tool(for testing purpose)

B : An html file

C : Both A & B

D : None of the above

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()

Q.no 9. Which of the method can be used to output a String in an Applet?

A : drawString( )

B : display( )

C : print( )

D : transient( )

Q.no 10. The Following steps are required to perform

1) Implement the Listener interface and overrides its methods


2) Register the component with the Listener.

A : Exception Handling

B : String Handling

C : Event Handling

D : None of the above

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.

A : Only A statement is true

B : Only B statement is true.

C : Only C statement is true.

D : All A,B and C are true.

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

Q.no 14. Which are the common security restrictions in applets?

A : Applets can't load libraries or define native methods

B : An applet can't read every system property

C : Applets can play sounds

D : Both A & B

Q.no 15. False statement about Java interface

A : It is used to achieve abstraction and multiple inheritance in Java.

B : It can be instantiated, means, we can create an object of an interface.

C : There can be only abstract methods in the interface not method body.

D : Object of an interface cannot be created.


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 64/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. The setBackground() method is part of the following class in java.awt package:

A : Component

B : Graphics

C : Container

D : Applet

Q.no 17. Which class cannot be sub classed?

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 20. What is subclass in java?

A : A subclass is a class that extends another class

B : A subclass is a class declared inside a class

C : A subclass is a class declared outside a class

D : A subclass is a class declare inside a interface

Q.no 21. Can data flow through a given stream in both directions?

A : No; streams only work for output.

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

Q.no 22. Which AWT component is not editable?

A : Button

B : Label

C : FlowLayout

D : TextField

Q.no 23. Which method is used to process mouse click?

A : public void mouseClicked(MouseListener m)

B : public void mouseIsClicked(MouseEvent m)

C : public void mouseClicked(MouseEvent m)

D : public void mouseClick(MouseEvent m)

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

Q.no 26. Which keyword is used to declare an interface in java?

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?

A : <applet class=Test width=200 height=100> </applet>

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

Q.no 31. How many types of controls does AWT support?


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 67/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 32. Which of the following statement is correct?

A : reverse() method reverses all characters

B : reverseall() method reverses all characters

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

Q.no 34. Button Control implements following listener interface.

A : ItemListener

B : ActionListener

C : FlowListener

D : Adapter

Q.no 35. What is the name of a stream that connects two running programs?

A : Program stream Program stream Program stream

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

D : java run time system

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.

A : class C implements A, implements B

B : class C implements A, B

C : class C implements A extends B

D : class C extends A extends B

Q.no 39. A java interface can contain —

A : public static Final Variables only

B : public Abstract methods

C : Abstract methods(unimplemented) and implemented methods both

D : public static Final Variables and abstract methods both

Q.no 40. DataInput is

A : n interface that defines methods to open files.

B : an abstract class defined in java.io.

C : an interface that defines methods to read primitive data types.

D : a class we can use to read primitive data types.

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

D : None of the above

Q.no 43. Which method is used to check the status of checkbox?

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()

Q.no 45. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )
(c) getSelectedIndex( )
(d) getItem( )

A : Both a & d

B : only b

C : a ,b, c & d

D : only a

Q.no 46. Which is true

A : "X extends Y" is correct if and only if X is a class and Y is an interface

B : "X extends Y" is correct if and only if X is an interface and Y is a class

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()

Q.no 49. Which of these are java.lang.Error in exception handling in java

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()

Q.no 51. What is the return type of lambda expression?

A : String

B : Object

C : void

D : Function

Q.no 52. What is the use of \w in regex?

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

B : Used for a non-whitespace character

C : Used for a word character

D : Used for a non-word character

Q.no 53. What do you mean by chained exceptions in Java?

A : Exceptions occurred by the VirtualMachineError

B : An exception caused by other exceptions

C : Exceptions occur in chains with discarding the debugging information

D : None of the above

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 : i, ii and iii only

B : ii, iii and iv only

C : i, iii and iv only

D : All i, ii, iii and iv

Q.no 55. How can we delete all files in a directory?

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

A : overridden method of subclass can throw any RuntimeException

B : overridden method of subclass cannot throw any checked exception

C : overridden method of subclass may not throw any exception

D : All of these

Q.no 57. What is a listener in context to event handling?

A : A listener is a variable that is notified when an event occurs

B : A listener is a object that is notified when an event occurs


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 72/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : A listener is a method that is notified when an event occurs

D : None of the above

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?

A : It has only methods

B : Objects can't be created

C : It has a fixed class name

D : It has no class name

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

Q.no 1. Which of the method can be used to output a String in an Applet?

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

Q.no 3. Exception is a class/interface/abstract class/other?

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()

Q.no 8. java.applet defines how many interfaces?

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

D : None of the above

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?

A : No; streams only work for output.

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

Q.no 14. What is the name of a stream that connects two running programs?

A : Program stream Program stream Program stream

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?

A : <applet class=Test width=200 height=100> </applet>

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

Q.no 17. Which method is used to process mouse click?

A : public void mouseClicked(MouseListener m)

B : public void mouseIsClicked(MouseEvent m)

C : public void mouseClicked(MouseEvent m)

D : public void mouseClick(MouseEvent m)

Q.no 18. Which AWT component is not editable?

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

D : java run time system

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

D : None of the above

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

Q.no 24. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )
(c) getSelectedIndex( )
(d) getItem( )

A : Both a & d

B : only b

C : a ,b, c & d

D : only a

Q.no 25. Which of the following statement is correct?

A : reverse() method reverses all characters

B : reverseall() method reverses all characters

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()

Q.no 28. Which is true

A : "X extends Y" is correct if and only if X is a class and Y is an interface

B : "X extends Y" is correct if and only if X is an interface and Y is a class

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()

A : (B), (C) & (E)

B : C), (D) & (E)

C : (A), (B), (C) & (E)

D : A), (B) & (C)

Q.no 30. Which are the common security restrictions in applets?

A : Applets can't load libraries or define native methods

B : An applet can't read every system property

C : Applets can play sounds

D : Both A & B

Q.no 31. The is an object that is notified when an event occurs.


(a) Listener
https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 79/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
(b) Sources
(c) Event

A : only a

B : only b

C : only c

D : All the above

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

Q.no 34. The method places a Menu m into


the MenuBar mb.
(a) mb.addMenuItem(m)
(b) mb.addItem(m)
(c) mb.add(m)

A : only a

B : only b

C : only c

D : All the above

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.

B : The class must implement all the five methods.

C : The class must not implement the five methods.

D : The class can extends few methods.


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 80/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 36. 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 37. Which keyword is used to declare an interface in java?

A : class

B : interface

C : implements

D : abstract

Q.no 38. Which are the valid ways to create DataInputStream streams?

A : new DataInputStream();

B : new DataInputStream(new File("in.dat"));

C : new DataInputStream("in.dat", "r");

D : new DataInputStream(new FileInputStream("in.dat");

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()

Q.no 41. How many types of controls does AWT support?

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

Q.no 42. Which class cannot be sub classed?

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()

Q.no 46. What exception thrown by parseInt() method?

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 47. A java interface can contain —

A : public static Final Variables only

B : public Abstract methods

C : Abstract methods(unimplemented) and implemented methods both

D : public static Final Variables and abstract methods both

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 : class Cat implements IAnimal{}

B : class Cat extends IAnimal{}

C : class Cat import IAnimal{}

D : class Cat export Ianimal{}

Q.no 51. What is the return type of lambda expression?

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

Q.no 55. How can we create a symbolic link to file?

A : createLink()

B : createSymLink()

C : createSymbolicLink()

D : createTempLink()

Q.no 56. What do you mean by chained exceptions in Java?

A : Exceptions occurred by the VirtualMachineError

B : An exception caused by other exceptions

C : Exceptions occur in chains with discarding the debugging information

D : None of the above

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

Q.no 1. The following


a) It is lightweight.
b) It supports pluggable look and feel.
c) It follows MVC (Model View Controller) architecture
are the advantages of .

A : AWT

B : Swing

C : Both A & B

D : None of the above

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()

Q.no 3. java.applet defines how many interfaces?


A:2

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

Q.no 5. The following example shows the creation of a


import java.applet.*;
import java.awt.*;

public class Main extends Applet{


public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}

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

D : None of the above

Q.no 6. What is used to run an Applet?

A : An AppletViewer tool(for testing purpose)

B : An html file

C : Both A & B

D : None of the above

Q.no 7. Which method is called only once during the run time of your applet?

A : stop()

B : paint()

C : destroy()

D : init()

Q.no 8. Which of these keywords is used to manually throw an exception?

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

Q.no 12. False statement about Java interface

A : It is used to achieve abstraction and multiple inheritance in Java.

B : It can be instantiated, means, we can create an object of an interface.

C : There can be only abstract methods in the interface not method body.

D : Object of an interface cannot be created.

Q.no 13. Which AWT component is not editable?


A : Button

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 15. A java interface can contain —

A : public static Final Variables only

B : public Abstract methods

C : Abstract methods(unimplemented) and implemented methods both

D : public static Final Variables and abstract methods both

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

Q.no 18. Which of these are java.lang.Error in exception handling in java

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

D : None of the above

Q.no 22. Which of the following statement is correct?

A : reverse() method reverses all characters

B : reverseall() method reverses all characters

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 23. Which method is used to check the status of checkbox?

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

D : None of the above

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.

A : class C implements A, implements B

B : class C implements A, B

C : class C implements A extends B

D : class C extends A extends B

Q.no 28. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )
(c) getSelectedIndex( )
(d) getItem( )

A : Both a & d

B : only b

C : a ,b, c & d

D : only a

Q.no 29. What is subclass in java?

A : A subclass is a class that extends another class

B : A subclass is a class declared inside a class

C : A subclass is a class declared outside a class

D : A subclass is a class declare inside a interface

Q.no 30. Which are the valid ways to create DataInputStream streams?

A : new DataInputStream();

B : new DataInputStream(new File("in.dat"));

C : new DataInputStream("in.dat", "r");

D : new DataInputStream(new FileInputStream("in.dat");

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()

A : (A), (B) & (E)

B : (A), (B), (C) & (E)

C : (B) & (E)

D : (D) & (E)

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?

A : An interface can contain only abstract method.

B : We can define a method in an interface

C : Private and protected access modifiers can also be used to declare methods in interface

D : We can define a constuctor in an 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()

Q.no 37. How many types of controls does AWT support?

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

Q.no 39. Where can the event handling code be written?

A : Same class

B : Other class

C : Anonymous class

D : All mentioned above

Q.no 40. Which of the following is true about AWT and Swing components.

A : AWT components creates a process where as swing components creates a thread

B : AWT components creates a thread where as swing components creates a process

C : Both AWT and Swing components creates a process

D : Both AWT and swing components creates a thread

Q.no 41. When comparing java.io.BufferedWriter and java.io.FileWriter, which capability


exist as a method in only one of two ?

A : closing the stream

B : flushing the stream


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 93/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : writting to the stream

D : writting a line separator to the stream

Q.no 42. What is the name of a stream that connects two running programs?

A : Program stream Program stream Program stream

B : Processing stream.

C : Pipe

D : Channel

Q.no 43. 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.

A : Only A statement is true

B : Only B statement is true.

C : Only C statement is true.

D : All A,B and C are true.

Q.no 44. Which of these class contains only floating point functions?

A : Math

B : Process

C : System

D : Object

Q.no 45. What exception thrown by parseInt() method?

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.

B : The class must implement all the five methods.

C : The class must not implement the five methods.

D : The class can extends few methods.

Q.no 48. The is an object that is notified when an event occurs.


(a) Listener
(b) Sources
(c) Event

A : only a

B : only b

C : only c

D : All the above

Q.no 49. MouseEvent is subclass of which of the following class?

A : ComponentEvent

B : ContainerEvent

C : ItemEvent

D : InputEvent

Q.no 50. What are the variables defined in Dimension?


(a) length and width
(b) height and width
(c) height and length

A : only a

B : only b

C : only c

D : All the above

Q.no 51. What is the use of \w in regex?

A : Used for a whitespace character

B : Used for a non-whitespace character


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 95/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
C : Used for a word character

D : Used for a non-word character

Q.no 52. How can we create a symbolic link to file?

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

D : None of the above

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

Q.no 56. What is a listener in context to event handling?

A : A listener is a variable that is notified when an event occurs

B : A listener is a object that is notified when an event occurs

C : A listener is a method that is notified when an event occurs

D : None of the above


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 96/13
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 57. Which of these class is super class of all the events?

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

A : i, ii and iii only

B : ii, iii and iv only

C : i, iii and iv only

D : All i, ii, iii and iv

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()

Q.no 2. Which of these keywords is used to manually throw an exception?

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()

Q.no 10. What is used to run an Applet?

A : An AppletViewer tool(for testing purpose)

B : An html file

C : Both A & B

D : None of the above

Q.no 11. What are the different types of controls in AWT?


A. Labels B. Pushbuttons C. Checkboxes D.Choice lists

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 12. 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.

A : Only A statement is true

B : Only B statement is true.

C : Only C statement is true.

D : All A,B and C are true.

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?

A : No; streams only work for output.

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
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

Q.no 16. method returns currently selected


item in choice.
(a) getSelectedItem( )
(b) getSelectedElement( )
(c) getSelectedIndex( )
(d) getItem( )

A : Both a & d

B : only b

C : a ,b, c & d

D : only a

Q.no 17. MouseEvent is subclass of which of the following class?

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?

A : <applet class=Test width=200 height=100> </applet>

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 : AWT components creates a process where as swing components creates a thread

B : AWT components creates a thread where as swing components creates a process

C : Both AWT and Swing components creates a process

D : Both AWT and swing components creates a thread

Q.no 23. Which keyword is used to declare an interface in java?

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

D : java run time system

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

Q.no 26. Button Control implements following listener interface.

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?

A : public void paint(Graphics g)

B : public void destroy()

C : public void stop()

D : public void init()

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

D : None of the above

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

Q.no 31. Which of the following statement is correct?

A : reverse() method reverses all characters

B : reverseall() method reverses all characters

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 32. What are the variables defined in Dimension?


(a) length and width
(b) height and width
(c) height and length

A : only a

B : only b

C : only c

D : All the above

Q.no 33. MVC architecture is

A : Modelling – Visual – Controller

B : Model – View – Controller

C : Model – Viewable – Controller

D : Many – View – Controller

Q.no 34. False statement about Java interface

A : It is used to achieve abstraction and multiple inheritance in Java.

B : It can be instantiated, means, we can create an object of an interface.

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.

D : Object of an interface cannot be created.

Q.no 35. Which of these exceptions handles the divide by zero error?

A : ArithmeticException

B : MathException

C : IllegalAccessException

D : IllegarException

Q.no 36. The is an object that is notified when an event occurs.


(a) Listener
(b) Sources
(c) Event

A : only a

B : only b

C : only c

D : All the above

Q.no 37. What is the name of a stream that connects two running programs?

A : Program stream Program stream Program stream

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)

B : (A), (B), (C) & (E)

C : (B) & (E)

D : (D) & (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()

Q.no 41. Which method is used to check the status of checkbox?

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

D : None of the above

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.

B : The class must implement all the five methods.

C : The class must not implement the five methods.

D : The class can extends few methods.

Q.no 44. A java interface can contain —

A : public static Final Variables only

B : public Abstract methods

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

D : public static Final Variables and abstract 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

Q.no 46. Which of these are java.lang.Error in exception handling in java

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.

A : class Cat implements IAnimal{}

B : class Cat extends IAnimal{}

C : class Cat import IAnimal{}

D : class Cat export Ianimal{}

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?

A : An interface can contain only abstract method.

B : We can define a method in an interface

C : Private and protected access modifiers can also be used to declare methods in interface

D : We can define a constuctor in an interface


https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1 107/14
16/10/2020 https://sppu.wheebox.com/WAC-3/allqusdownloadhtml.ils?testNo=1162&code=1052000&showTest=1037&actForm=edit&set=1
Q.no 50. Order of execution of constructors in Java Inheritance is

A : Base to derived class

B : Derived to base class

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?

A : RuntimeException and Error class

B : Exception and VirtualMachineError class

C : Error and Exception class

D : IOException and VirtualMachineError 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

Q.no 54. How can we delete all files in a directory?

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

A : 1-i, 2-ii, 3-iii, 4-iv, 5-v

B : 1-ii, 2-iii, 3-iv, 4-v, 5-i

C : 1-iv, 2-i, 3-ii, 4-iii, 5-v

D : 1-iii, 2-iv, 3-v, 4-i, 5-ii

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()

Q.no 59. What do you mean by chained exceptions in Java?

A : Exceptions occurred by the VirtualMachineError

B : An exception caused by other exceptions

C : Exceptions occur in chains with discarding the debugging information

D : None of the above

Q.no 60. Which package contains the Random class?

A : java.util package

B : java.lang package

C : java.awt package

D : java.io package

Q.no 1. Which of these keywords is not a part of exception handling?

A : try

B : catch

C : thrown

D : finaly

Q.no 2. Which of these constructors is used to create an empty String object?

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

Q.no 4. The following example shows the creation of a


import java.applet.*;
import java.awt.*;

public class Main extends Applet{


public void paint(Graphics g){
g.drawString("Welcome in Java Applet.",40,20);
}

A : Banner using Applet

B : Basic Applet

C : Display clock

D : None of the above

Q.no 5. Java Applets are used to create applications.

A : Graphical

B : user interactive

C : Both A & B

D : None of these

Q.no 6. Which method can set or change the text in a Label?

A : setText()

B : getText()

C : Both A & B

D : All the above

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

Q.no 13. Which of these are java.lang.Error in exception handling in java

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();

B : new DataInputStream(new File("in.dat"));

C : new DataInputStream("in.dat", "r");

D : new DataInputStream(new FileInputStream("in.dat");

Q.no 15. Which keyword is used to declare an interface in java?

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

Q.no 18. The is an object that is notified when an event occurs.


(a) Listener
(b) Sources
(c) Event

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

D : All the above

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

Q.no 20. Which of the following statement is correct?

A : reverse() method reverses all characters

B : reverseall() method reverses all characters

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 21. What are the different types of controls in AWT?


A. Labels B. Pushbuttons C. Checkboxes D.Choice lists

A : A,B &C

B : A,B,C & D

C : B, C & D

D : A,C &D

Q.no 22. Button Control implements following listener interface.

A : ItemListener

B : ActionListener

C : FlowListener

D : Adapter

Q.no 23. Which is true

A : "X extends Y" is correct if and only if X is a class and Y is an interface

B : "X extends Y" is correct if and only if X is an interface and Y is a class

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

Q.no 24. What are the variables defined in Dimension?


(a) length and width
(b) height and width
(c) height and length

A : only a

B : only b

C : only c

D : All the above

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

Q.no 29. Which class cannot be sub classed?

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

Q.no 31. Order of execution of constructors in Java Inheritance is

A : Base to derived class

B : Derived to base class

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

D : None of the above

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

Q.no 33. Which AWT component is not editable?

A : Button

B : Label

C : FlowLayout

D : TextField

Q.no 34. Which applet java.awt.component class provides the life cycle method?

A : public void paint(Graphics g)

B : public void destroy()

C : public void stop()

D : public void init()

Q.no 35. Which are the common security restrictions in applets?

A : Applets can't load libraries or define native methods

B : An applet can't read every system property

C : Applets can play sounds

D : Both A & B

Q.no 36. What exception thrown by parseInt() method?

A : ArithmeticException

B : ClassNotFoundException

C : NullPointerException

D : NumberFormatException

Q.no 37. Where can the event handling code be written?

A : Same class

B : Other class

C : Anonymous class

D : All mentioned above

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()

Q.no 40. False statement about Java interface

A : It is used to achieve abstraction and multiple inheritance in Java.

B : It can be instantiated, means, we can create an object of an interface.

C : There can be only abstract methods in the interface not method body.

D : Object of an interface cannot be created.

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 42. MVC architecture is

A : Modelling – Visual – Controller

B : Model – View – Controller

C : Model – Viewable – Controller

D : Many – View – Controller

Q.no 43. Can data flow through a given stream in both directions?

A : No; streams only work for output.

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.

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.

A : class C implements A, implements B

B : class C implements A, B

C : class C implements A extends B

D : class C extends A extends B

Q.no 47. What is subclass in java?

A : A subclass is a class that extends another class

B : A subclass is a class declared inside a class

C : A subclass is a class declared outside a class

D : A subclass is a class declare inside a interface

Q.no 48. Which method is used to process mouse click?

A : public void mouseClicked(MouseListener m)

B : public void mouseIsClicked(MouseEvent m)

C : public void mouseClicked(MouseEvent m)

D : public void mouseClick(MouseEvent m)

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

D : java run time system

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 : class Cat implements IAnimal{}

B : class Cat extends IAnimal{}

C : class Cat import IAnimal{}

D : class Cat export Ianimal{}

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

A : 1-i, 2-ii, 3-iii, 4-iv, 5-v

B : 1-ii, 2-iii, 3-iv, 4-v, 5-i

C : 1-iv, 2-i, 3-ii, 4-iii, 5-v

D : 1-iii, 2-iv, 3-v, 4-i, 5-ii

Q.no 52. What do you mean by chained exceptions in Java?

A : Exceptions occurred by the VirtualMachineError

B : An exception caused by other exceptions

C : Exceptions occur in chains with discarding the debugging information

D : None of the above

Q.no 53. What is the use of \w in regex?

A : Used for a whitespace character

B : Used for a non-whitespace character

C : Used for a word character

D : Used for a non-word character

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

Q.no 56. How can we delete all files in a directory?

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?

A : It has only methods

B : Objects can't be created

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

C : It has a fixed class name

D : It has no class name

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

You might also like