Explore topic-wise MCQs in Bachelor of Computer Applications (BCA).

This section includes 32 Mcqs, each offering curated multiple-choice questions to sharpen your Bachelor of Computer Applications (BCA) knowledge and support exam preparation. Choose a topic below to get started.

1.

If an expression contains double, int, float, long, then the whole expression will be promoted into which of these data types?

A. long
B. int
C. double
D. float
Answer» D. float
2.

When method defined in subclass which has same signature as a method in a super class, it is known as method

A. Overloading
B. Overriding
C. Packing
D. None of these
Answer» C. Packing
3.

To design a general-purpose search method, searchList, to search a list, which of the following must be parameters of the method searchList? (i) The array containing the list. (ii) The length of the list. (iii) The search item. (iv) A boolean variable indicating whether the search is successful.

A. (i) and (ii)
B. (i), (ii), and (iii)
C. (ii), (iii), and (iv)
D. (i), (ii), (iii), and (iv)
Answer» C. (ii), (iii), and (iv)
4.

Which of these is the method which is executed first before execution of any other thing takes place in a program?

A. main method
B. finalize method
C. static method
D. private method
Answer» D. private method
5.

Which of these exceptions will occur if we try to access the index of an array beyond its length?

A. ArithmeticException
B. ArrayException
C. ArrayIndexException
D. ArrayIndexOutOfBoundsException
Answer» E.
6.

In RMI which layer defines and supports the invocation semantics of the RMI connection, this layer maintains the session during the method call?

A. The Stub & Skeleton Layer
B. The Application Layer
C. The Remote Reference Layer
D. The Transport Layer
Answer» D. The Transport Layer
7.

State true or false (i) JPanel is a class included in awt package (ii) Anonymous classes are mostly used for event handling (iii) Names of anonymous classes must be unique (iv) JOptionPane is an inner class

A. i-false, ii-false, iii-true, iv-true
B. i-true, ii-false, iii-true, iv-false
C. i-false, ii-true, iii-false, iv-false
D. i-true, ii-true, iii-false, iv-true
Answer» D. i-true, ii-true, iii-false, iv-true
8.

Which of these packages contains all the classes and methods required for event handling in Java? a) jav

A. applet
B. java.awt
C. java.event
D. java.awt.event
Answer» E.
9.

Which package consist an applet class? a) jav

A. applet
B. java.awt
C. java.awt.applet
D. java.event
Answer» B. java.awt
10.

State true or false (i) Java RMI supports distributed objects written entirely in java (ii) Java RMI makes use of stubs and skeleton (iii) In Java RMI an object registers itself with a media server (iv) IDL is interface declaration language

A. True, True, False, False
B. False, True, True, True
C. True, False, True, False
D. True, True, True, True
Answer» B. False, True, True, True
11.

Match the following(a) Datagram Socket (i) UDP connection(b) URL (ii) provides a necessary framework of debugging java programs(c) java.net (iii) makes it possible to communicate over a network with java programs(d) sun.tools.debug (iv) is a java object that represents WWW address

A. a-i, b-iv, c-iii, d-ii
B. a-i, b-iv, c-ii, d-iii
C. a-ii, b-iii, c-i, d-iv
D. a-ii, b-i, c-iii, d-iv
Answer» B. a-i, b-iv, c-ii, d-iii
12.

Which of the interface contains all the methods used for handling thread related operations in Java?

A. Runnable interface
B. Math interface
C. System interface
D. ThreadHandling interface
Answer» B. Math interface
13.

Which method of the Naming class (found in java.rmi) is used to update the RMI registry on the server machine?

A. rebind ()
B. lookup()
C. Both A & B
D. None of the above
Answer» B. lookup()
14.

In RMI program the following example shows the, import java.rmi.*; public interface Adder extends Remote{ public int add(int x,int y)throws RemoteException; }

A. Create and start the remote application
B. Create and start the client application
C. Create the remote interface
D. Provide the implementation of the remote interface
Answer» D. Provide the implementation of the remote interface
15.

Consider the following program: import myLibrary.*; public class ShowSomeClass { // code for the class... } What is the name of the java file containing this program?

A. myLibrary.java
B. ShowSomeClass.java
C. ShowSomeClass
D. ShowSomeClass.class 1.
Answer» C. ShowSomeClass
16.

__________ provides the naming services for the server to register the object and for the client to locate the object.

A. Server stub
B. RMI Registry
C. Server implementation
D. Server Skeleton
Answer» C. Server implementation
17.

An Applet has its Layout Manager set to the default of FlowLayout. What code would be the correct to change to another Layout Manager?

A. setLayoutManager(new GridLayout());
B. setLayout(new GridLayout(2,2));
C. setGridLayout(2,2);
D. setBorderLayout();
Answer» C. setGridLayout(2,2);
18.

For the interface WindowListener that contains more than one method, Java provides the class ____.

A. MouseAdapter
B. WindowAdapter
C. KeyListener
D. KeyAdapter
Answer» C. KeyListener
19.

Which of the following statements is legal in Java? (i) mysRef = (Mystery) mySecret; (ii) mysRef = (Mystery) secRef;

A. Only (i)
B. Only (ii)
C. Both (i) and (ii)
D. None of these
Answer» C. Both (i) and (ii)
20.

Which is the container that doesn't contain title bar and MenuBars. It can have other components like button, textfield etc?

A. Window
B. Frame
C. Panel
D. Container
Answer» D. Container
21.

What is the string contained in s after following lines of code? StringBuffer s new StringBuffer("Hello"); s.deleteCharAt(0);

A. Hell
B. ello
C. Hel
D. llo
Answer» C. Hel
22.

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()
Answer» B. Length()
23.

Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?

A. break
B. return
C. exit
D. continue
Answer» E.
24.

In order for a source code file, containing the public class test, to successfully compile, which of the following must be true?

A. It must have a package statement
B. It must be named test.java
C. It must import java.lang
D. It must declare a public class named test.
Answer» C. It must import java.lang
25.

Which of these methods can be used to obtain the command name for invoking ActionEvent object?

A. getCommand()
B. getActionCommand()
C. getActionEvent()
D. getActionEventCommand()
Answer» C. getActionEvent()
26.

Java supports input/output of data through the classes included in the _______ package: a) jav

A. oi
B. java.out
C. java.in
D. java.io
Answer» E.
27.

Which of the following is the correct syntax for suggesting that the JVM performs garbage collection?

A. System.free();
B. System.setGarbageCollection();
C. System.out.gc();
D. System.gc();
Answer» E.
28.

Which of these exceptions will be thrown if we use null reference for an arithmetic operation?

A. ArithmeticException
B. NullPointerException
C. IllegalAccessException
D. IllegalOperationException
Answer» C. IllegalAccessException
29.

Which of the following package stores all the standard java classes? a) jav

A. lang
B. java
C. java.util
D. java.packages
Answer» B. java
30.

When two or more objects are added as listeners for the same event, which listener is first invoked to handle the event?

A. The first object that was added as listner.
B. The last object that was added as listner
C. There is no way to determine which listener will be invoked first.
D. It is impossible to have more than one listener for a given event.
Answer» D. It is impossible to have more than one listener for a given event.
31.

Swing is not a part of JFC (Java Foundation Classes) that is used to create GUI application?

A. True
B. False
C. none
D. all
Answer» C. none
32.

Which of these packages contains all the classes and methods required for even handling in Java?

A. java.applet
B. java.awt
C. java.event
D. java.awt.event
Answer» E.