Question No. 1
Which one of the following feature is not available in Java?
Select correct option:
Data hiding
Data encapsulation
Single inheritance
Multiple inheritance
Question No. 2
Which of the following statement regarding Java is false?
The Java program can run on any CPU or operating system.
Its object-oriented model enables programmers to benefit from its large set of existing classes.
Java needs to be compiled only once.
Java can run only on a Windows operating system.
Question No. 3
The collection API are defined in _______ package.
Select correct option:
java.io
java.util
java.awt
java.sql
Question No. 4
If a super class method is protected then overriding method _________
Select correct option:
must be protected
must be public
must be private
may be either protected or public
Question No. 5
Array List is an example of _______collection type.
Sequence based
Set based
Hashmap based
None of the given
Question No. 6
Which of the following command is used to compile Java code?
javac filename.java
javac filename
java filename.java
java filename
Question No. 7
Static methods can only access __________
Instance variables
Instance methods
Static variables and methods
Question No. 8
What will happen if main method is declared as private?
The program does not compile
The program throws an exception at run time
The program compiles and runs successfully
None of given options
Question No. 9
If we want to call toString() method of parent class in JAVA. Which of the following statement will be used?
this. toString();
new. toString();
sub. toString();
super.toString();
Question No. 10
Strings in java are represented as __________
Primitive data types
Reference data types
Native data types
Objects
Which one of the following feature is not available in Java?
Select correct option:
Data hiding
Data encapsulation
Single inheritance
Multiple inheritance
Question No. 2
Which of the following statement regarding Java is false?
The Java program can run on any CPU or operating system.
Its object-oriented model enables programmers to benefit from its large set of existing classes.
Java needs to be compiled only once.
Java can run only on a Windows operating system.
Question No. 3
The collection API are defined in _______ package.
Select correct option:
java.io
java.util
java.awt
java.sql
Question No. 4
If a super class method is protected then overriding method _________
Select correct option:
must be protected
must be public
must be private
may be either protected or public
Question No. 5
Array List is an example of _______collection type.
Sequence based
Set based
Hashmap based
None of the given
Question No. 6
Which of the following command is used to compile Java code?
javac filename.java
javac filename
java filename.java
java filename
Question No. 7
Static methods can only access __________
Instance variables
Instance methods
Static variables and methods
Question No. 8
What will happen if main method is declared as private?
The program does not compile
The program throws an exception at run time
The program compiles and runs successfully
None of given options
Question No. 9
If we want to call toString() method of parent class in JAVA. Which of the following statement will be used?
this. toString();
new. toString();
sub. toString();
super.toString();
Question No. 10
Strings in java are represented as __________
Primitive data types
Reference data types
Native data types
Objects
Comments
Post a Comment
Please give us your feedback & help us to improve this site.