Test your Knowledge in Java by answering the questions. Once your done you will find out your own strengths and weekness.
Public constructors.
public instance variables.
public methods
All of the above.
Methods.
Constructors
Variables (or fields).
All of the above.
Methods and instance variables can both be either public or private.
Information hiding is achieved by restricting access to class members via keyword public.
The private members of a class are directly accessible to the client of a class.
None of the above is true.
A method to refer explicitly to the instance variables and other methods of the object on which the method was called.
A method to refer implicitly to the instance variables and other methods of the object on which the method was called.
An object to reference itself.
All of the above.
Be overloaded.
Initialize variables to their defaults.
Specify return types or return values.
Have the same name as the class.
Initialize instance variables.
When overloaded, can have identical argument lists.
When overloaded, are selected by number, types and order of types of parameters.
A and c.
Zero-argument constructor.
No-argument constructor.
Default constructor
Main constructor.
Is-a relationship.
Has-a relationship.
Many-in-one relationship.
One-to-many relationship
Are final.
Are public
Are private
Are shared by all objects of a class
Static import java.lang.Math.*.
Import static java.lang.Math.*.
static import java.lang.Math
Import static java.lang.Math
A directory structure used to organize classes and interfaces.
A mechanism for software reuse
A group of related classes and interfaces
All
It will be used only by other classes in the same package
It will be used by classes that are not in the same package
It is in the same directory as the other classes in the package.
It has a unique name
The statement declares a package that exists at deitel.com
The statement uses the Sun Microsystems convention of package naming
The statement should be placed inside the class declaration
The statement will generate a compile time error
Single-type-import declaration.
All-type-import declaration
Multiple-import declaration
Type-import-on-demand declaration
Causes a compilation error
Imports all classes in the library.
Imports the default classes in the library
Imports the classes in package java.lang
A
B
C
D
E
F
GetWelcomeMessage()
GetWelcomeMessage
Welcome!!!
It would give a compilation error
* * * * *
*****
******
* * * * * *
None of the above
Rate this question:
Int
Long
Double
30
None of the above
Yes
No
Rate this question:
14
18
None of the above
Rate this question:
X >= 1000 && x
X > 1000 && x < 2000
X < 1000 && x >= 2000
X > 1000 && x
None of the above
Portable
Cheap
Relatively Simple
High Speed Execution
Applets
Servlets
Javascript
JavaBeans
.class
.java
.jar
.out
Bitcode
Bitecode
Bytecode
Bycode
Java Virtual Machine
Java Real Machine
Java Running Machine
Java Verbal Machine
Define the problem
Code the program
Install the program
Test and debug the program
True
False
Servlet
Applet
JavaBeans
EJB
Java Microsystem
Sun Macrosystem
Java Macrosystem
Sun Microsystem
1
2
3
4
//
*()
/* and *//
Both a and c
AC
BC
ACD
ABCD
Thread t = new Thread(X);
Thread t = new Thread(X); t.start();
X run = new X(); Thread t = new Thread(run); t.start();
Thread t = new Thread(); x.run();
Test( )
Public Test( )
Test(void)
Public Test(void)
Final
Private
Protected
Default
C,C++,JAVA
C,JAVA,RUBY
C++,JAVA,BASIC
BASIC,FORTRAN,JAVA
C++,JAVA,C#
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.