Explore topic-wise MCQs in Technical Programming.

This section includes 1671 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

1651.

Which of these is a process of writing the state of an object to a byte stream?

A. Serialization
B. Externalization
C. File Filtering
D. All of the mentioned
Answer» B. Externalization
1652.

Which of the following is/are legal method declarations? a. protected abstract void m1(); b. static final void m1(){} c. synchronized public final void m1() {} d. private native void m1();

A. 1 and 3
B. 2 and 4
C. 1 only
D. All of them are legal declarations.
Answer» E.
1653.

You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

A. public
B. private
C. protected
D. transient
Answer» D. transient
1654.

Which of the following is correct constructor for thread?

A. Thread(Runnable a, String str)
B. Thread(int priority)
C. Thread(Runnable a, int priority)
D. Thread(Runnable a, ThreadGroup t)
Answer» B. Thread(int priority)
1655.

What is true about time slicing?

A. Time slicing is OS service that allocates CPU time to available runnable thread
B. Time slicing is the process to divide the available CPU time to available runnable thread
C. Time slicing depends on its implementation in OS
D. Time slicing allocates more resources to thread
Answer» C. Time slicing depends on its implementation in OS
1656.

What is the output of this program? import java.util.*; class Bitset { public static void main(String args[]) { BitSet obj = new BitSet(5); for (int i = 0; i < 5; ++i) obj.set(i); obj.clear(2); System.out.print(obj); } }

A. {0, 1, 3, 4}
B. {0, 1, 2, 4}
C. {0, 1, 2, 3, 4}
D. {0, 0, 0, 3, 4}
Answer» B. {0, 1, 2, 4}
1657.

What is Collection in Java?

A. A group of objects
B. A group of classes
C. A group of interfaces
D. None of the mentioned
Answer» B. A group of classes
1658.

Which of these interface is not a part of Java’s collection framework?

A. List
B. Set
C. SortedMap
D. SortedList
Answer» E.
1659.

Which method of string class in java is used to convert the boolean into String?

A. public static String valueOf(double I)
B. public static String valueOf(boolean I)
C. public boolean equals(Object anObject)
D. public static String valueOf(Object obj)
Answer» B. public static String valueOf(boolean I)
1660.

Which is used to separate the hierarchy of the class while declaring an import statement?

A. Package
B. Applet
C. Browser
D. All of the above
Answer» B. Applet
1661.

Give the Output for the following program? class Char { public static void main(String args[]) { char ch1, ch2; ch1 = 88; // code for X ch2 = 'Y'; System.out.print("ch1 and ch2: "); System.out.println(ch1 + " " + ch2); } }

A. ch1 and ch2: X Y
B. ch1 and ch2: x y
C. ch1 and ch2: 1 3
D. None of the above
Answer» B. ch1 and ch2: x y
1662.

What are the exceptions which have to be handled in a RMI client program? 

A. RemoteException
B. NotBoundException
C. MalFormedURLException
D. All mentioned above
Answer» E.
1663.

Which component does the Entity bean represent the persistent data stored in the database?

A. Server-side component 
B. Client-side component
C. server and client side component
D. None of the above
Answer» B. Client-side component
1664.

Which cookie it is valid for single session only and it is removed each time when the user closes the browser?

A. Persistent cookie
B. Non-persistent cookie
C. All the above
D. None of the above
Answer» C. All the above
1665.

Which is used to call the stored procedures and functions?

A. CallableStatement Interface
B. PreparedStatement Interface
C. All the above
D. None of the above
Answer» B. PreparedStatement Interface
1666.

If you are inserting any value in the wrong index as shown below, 1. int a[]=new int[5]; 2. a[10]=50; it would result in ______.

A. NullPointerException
B. ArrayIndexOutOfBoundsException 
C. ArithmeticException
D. NumberFormatException
Answer» C. ArithmeticException
1667.

The following program is an example of? class Simple{ public static void main(String args[]){ String s="Sachin"; System.out.println(s.length());//6 } }

A. length() method 
B. intern() method
C. trim() method
D. charAt() method
Answer» B. intern() method
1668.

Which variables are created when an object is created with the use of the keyword 'new' and destroyed when the object is destroyed?

A. Local variables
B. Instance variables
C. Class Variables
D. Static variables
Answer» C. Class Variables
1669.

Java supports RMI, RMI Stands for?

A. Random Method Invocation
B. Remote Memory Interface
C. Remote Method Invocation 
D. Random Method Invocation
Answer» D. Random Method Invocation
1670.

Which constructor creates an empty string buffer with the specified capacity as length.

A. StringBuffer()
B. StringBuffer(String str)
C. StringBuffer(int capacity)
D. None of the above
Answer» D. None of the above
1671.

Which method is used to change the name of a thread?

A. public String getName()
B. public void setName(String name)
C. public void getName()
D. public String setName(String name)
Answer» C. public void getName()