MCQ

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

Which is true about Java.

A. Java doesn’t support the overloading.


B. Java has replaced the destructor function of the C++
C. There are no any header files in the Java.
D. All of the above.
ANSWER:D
______are not machine instructions and the Java interpreter generate machine codes
that is directly executed by machine running the Java program.
A. Compiled Instructions
B. Compiled code
C. byte code
D. Java mid code
ANSWER:C
The command javac
A. Converts the java program to binary code
B. Converts the java program to bytecode
C. Converts the java program to machine language
D. None of these
ANSWER:B
Which is not primitive type of Java
A. Float
B. Byte
C. Character
D. Long double
ANSWER:D
Command to execute compiled java program is?
A. java
B. run
C. javac
D. javaw
ANSWER:A
Inner classes are?
A. anonymous classes
B. nested classes
C. sub classes
D. derived classes
ANSWER:B
How many times does code segment execute int x=1, y=10, z=1; do{y--; x++; y-=2;
y=z; z++} while (y>1 && z<10);
A. 1
B. 10
C. 5
D. infinite
ANSWER:A
Prepared statement object in the JDBC is being used to ins executing ____ queries.
A. Executable
B. simple
C. high level
D. parameterized
ANSWER:D
In JDBC ____ imports all Java classes that is concerned with the database
connectivity.
A. javax.sql.*
B. java.mysql.*
C. java.sql.*
D. com.*
ANSWER:C
A method name myMethod( ) that needs 2 integer arguments is declared as?
A. public void myMethod( );
B. public void myMethod(int a, int B.;
C. public void myMethod(int a, B.;
D. public int myMethod(a, B.;
ANSWER:B
Class string belongs to the ____package.
A. java.awt
B. java.lang
C. java.applet
D. java.string
ANSWER:D
______package is being used by the compiler itself. So, it doesn’t need to be
imported for use.
A. java.math
B. java.awt
C. java.applet
D. java.lang
ANSWER:D
The ____and the ____classes are abstract classes supporting reading and writing of
the byte streams.
A. reader, writer
B. inputstream, outputstream
C. objectinputstream, objectoutputstream
D. none
ANSWER:B
A package is a collection of?
A. classes
B. interfaces
C. editing tools
D. classes and interfaces
ANSWER:D
Which methods belong to string class?
A. length( )
B. compare To ( )
C. equals ( )
D. All of them
ANSWER:D
What is the output of the code? byte x=64, y; y= (byte) (x<<2);
System.out.println(y);
A. 0
B. 1
C. 2
D. 64
ANSWER:A
If m and the n are int type variables, what is result of the expression m%n when
m=5 and n=2 ?
A. 0
B. 1
C. 2
D. None of the above
ANSWER:B
Which of the control expressions are valid when it comes to if statement?
A. An integer expression
B. A Boolean expression
C. Either A or B
D. Neither A nor B
ANSWER:B
The concept of the multiple inheritance is being implemented in the Java by?
A. extending two or more classes
B. extending one class and implementing one or more interfaces
C. implementing two or more interfaces
D. both b and c
ANSWER:B

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy