250
100.4k

610+ Java Programming Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Computer Applications (BCA) , Bachelor of Science in Computer Science (BSc CS) , Master of Computer Applications (MCA) , Programming Languages .

401.

Java is designed for _______ environment of the internet.

A. development.
B. deducting.
C. distributed.
D. web design.
Answer» C. distributed.
402.

______ is a small unit of a process.

A. method.
B. thread.
C. applet.
D. stream.
Answer» B. thread.
403.

Wrapper class is a wrapper around a _______ data type.

A. normal.
B. central.
C. primitive.
D. concrete.
Answer» C. primitive.
404.

Once an interface has been defined, one or more _____ can implement that interface.

A. class.
B. object.
C. methods.
D. keywords.
Answer» A. class.
405.

Variable declared as _________ do not occupy memory on a per instance basis.

A. static.
B. final.
C. abstract.
D. Ccde.
Answer» B. final.
406.

______ must be the first statement executed inside a subclass Constructor.

A. final().
B. super().
C. static().
D. dec().
Answer» B. super().
407.

The ________ connects classes and objects.

A. dot.
B. super.
C. new.
D. variable.
Answer» A. dot.
408.

The ________ statement is used to terminate a statement sequence.

A. break.
B. switch.
C. continue.
D. wait.
Answer» A. break.
409.

Multidimensional arrays are actually __________.

A. arrays of element.
B. arrays and variable.
C. arrays of arrays.
D. arrays of Square.
Answer» C. arrays of arrays.
410.

______ statement in java is multiway branch statement.

A. declaration.
B. case.
C. multi.
D. switch.
Answer» D. switch.
411.

_______ can be declared inside interface declarations.

A. Variables.
B. Classes.
C. Methods.
D. Keywords.
Answer» A. Variables.
412.

The _______ supports several constructors to create an empty String.

A. string class.
B. super class.
C. empty class.
D. upper class.
Answer» B. super class.
413.

__________ is used for initialize the value to the String object.

A. character literals.
B. string literals.
C. string group literals.
D. group literals.
Answer» B. string literals.
414.

____ operators which concatenates two strings.

A. +.
B. ++.
C. -.
D. ++, ++.
Answer» A. +.
415.

_______ method is a thread mechanism.

A. synchronize.
B. user defined.
C. keyword.
D. normal.
Answer» A. synchronize.
416.

Java programs are _________ independent.

A. platform.
B. procedural.
C. high level.
D. Secure.
Answer» A. platform.
417.

A java program can be run in any computer running under any ________.

A. operating system.
B. interface system.
C. machine system.
D. moral system.
Answer» A. operating system.
418.

A java program must contain a______ method.

A. user defined.
B. main.
C. local.
D. return.
Answer» B. main.
419.

Which of these class holds a collection of static methods and variables?.

A. Void .
B. Process.
C. Runtime .
D. System.
Answer» D. System.
420.

_________ operator is used to create an array.

A. new .
B. public.
C. key.
D. main.
Answer» A. new .
421.

Which of these class is used to create an object whose character sequence is mutable?.

A. String().
B. StringBuffer().
C. Both of the mentioned.
D. None of the mentioned.
Answer» B. StringBuffer().
422.

The variable defined in class is called ________ variable.

A. local.
B. minimum.
C. instance.
D. define.
Answer» C. instance.
423.

A special type of method that is used to initialize an object is called________.

A. constructor.
B. destructor.
C. modification.
D. editor.
Answer» A. constructor.
424.

Class is considered ________ of an object and instance.

A. min.
B. local.
C. template.
D. keyword.
Answer» C. template.
425.

String constants are said to be_____ of string class.

A. objects.
B. char.
C. data.
D. variable.
Answer» A. objects.
426.

Methods having same name and differ type signature are called _____methods.

A. overriding.
B. over read.
C. super.
D. overloading.
Answer» D. overloading.
427.

Methods having same name, same type signature are called _____ methods.

A. overriding.
B. overloading.
C. overwriting.
D. overreading.
Answer» A. overriding.
428.

A method without the body is called ________ method.

A. view.
B. class.
C. abstract.
D. user defined.
Answer» C. abstract.
429.

A class having an abstract method is to be declared as _______.

A. class.
B. abstract.
C. class name.
D. method name.
Answer» B. abstract.
430.

Package statement helps to create many classes to have ______ name.

A. differ.
B. vanity.
C. same.
D. punch.
Answer» C. same.
431.

The default package that is implicitly called in a java program is _________.

A. java.Lang.
B. java.System.
C. java. Window.
D. java.Lang.System.
Answer» A. java.Lang.
432.

User defined exception can be created using _________ class.

A. catch.
B. try.
C. throwable.
D. get.
Answer» C. throwable.
433.

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

A. finally.
B. catch.
C. thrown.
D. try.
Answer» C. thrown.
434.

Exception that is identified during compile time is called ______ exception.

A. user defined.
B. checked.
C. undefined.
D. defined.
Answer» B. checked.
435.

When several tasks are handled by a single CPU, it is called _________.

A. multitasking.
B. task.
C. simultaneous.
D. taker.
Answer» A. multitasking.
436.

Threads can be created by extending _________ class.

A. new.
B. operator.
C. thread.
D. super thread.
Answer» C. thread.
437.

Threads can be created by implementing ________ interface.

A. new.
B. creator.
C. main.
D. runnable.
Answer» D. runnable.
438.

When a thread is created using new operator, the thread is in _____ state.

A. new.
B. old.
C. horizontal.
D. default.
Answer» A. new.
439.

At any one instance of time _____ threads will be in running state.

A. many.
B. two.
C. three.
D. one.
Answer» D. one.
440.

Which of these classes are used by character streams for input and output operations?.

A. InputStream.
B. Writer.
C. ReadStream.
D. InputOutputStream.
Answer» B. Writer.
441.

The wrapper classes are defined in _________ packages.

A. java. Lan.
B. java. Lang.
C. java. Nill.
D. java.Math.
Answer» B. java. Lang.
442.

The capacity if StringBuffer is defined as _________.

A. Length+12.
B. Length+13.
C. Length+15.
D. Length+16.
Answer» D. Length+16.
443.

To compare the contents of two objects ______ method is used.

A. equals.
B. not equals.
C. multiple.
D. delay.
Answer» A. equals.
444.

Which of these class is used to read from byte array?.

A. InputStream.
B. BufferedInputStream.
C. ArrayInputStream.
D. ByteArrayInputStream.
Answer» D. ByteArrayInputStream.
445.

Graphics object can only be drawn on _________.

A. view.
B. windows.
C. applet.
D. zoom.
Answer» B. windows.
446.

What is byte code in the context of Java?

A. The type of code generated by a Java compiler.
B. The type of code generated by a Java Virtual Machine.
C. It is another name for a Java source file.
D. It is the code written within the instance methods of a class.
Answer» A. The type of code generated by a Java compiler.
447.

What is garbage collection in the context of Java?

A. The operating system periodically deletes all of the java files available on the~~~system.
B. Any package imported in a program and not used is automatically deleted.
C. When all references to an object are gone, the memory used by the object is~~~automatically reclaimed.
D. The JVM checks the output of any Java program and deletes anything that~~~doesn't make sense.
Answer» C. When all references to an object are gone, the memory used by the object is~~~automatically reclaimed.
448.

What output is displayed as the result of executing the following statement?System.out.println ("// Looks like a comment.");

A. // Looks like a comment.
B. The statement results in a compilation error.
C. Looks like a comment.
D. No output is displayed.
Answer» C. Looks like a comment.
449.

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» B. It must be named Test.java.
450.

What is the value of a [3] as the result of the following array declaration?

A. 1.
B. 2.
C. 3.
D. 4.
Answer» D. 4.

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.