Menu

Objective Type Questions & Answers


Java Programming Objective Type Questions-Part-1



1. Which provides runtime environment for java byte code to be executed?

A . JDK

B . JVM

C . JRE

D . JAVAC

Answer



2. 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



3. Choose a Single Line Comment in Java Language below?

A . //Some comments

B . Some comments//

C . /*Some comments*/

D . */Some comments/*

Answer



4. A valid identifier in Java language may contain which characters?

A . 0-9

B . A-Z, a-z

C . $, _ (Underscore)

D . All the above

Answer



5. In Java, Multi-line comments are represented by _____________

A . //

B . /* */

C . /# #/

D . */ */

Answer



6. The Primitive data types in java are ____________________

A . Pre-defined data types

B . User-defined data types

C . Both

D . None of the above

Answer



7. Which of the following expression is an invalid?

A . int Abc = 12;

B . String full_name = "yourname";

C . float 4d = 12.3f;

D . double d$ = 1234.456d;

Answer



8. In java, The instance variable is declared ____________________.

A . inside the method

B . inside class but outside the method

C . inside class but outside the method and it is static

D . outside the class

Answer



9. A data type is converted into another data type by the programmer is known as ____________?

A . Type Conversion

B . Implicit conversion

C . Type Casting

D . None of the above

Answer



10. Which one is true about a constructor ?

A . A constructor must have the same name as the class it is declared within.

B . A constructor is used to Initialize the objects.

C . A constructor may be declared private

D . All of the above

Answer



11. What are the keywords used to implement a SWITCH case in Java language?

A . switch, case

B . default

C . break

D . All

Answer



12. Which of the following statement is invalid?

A . break - immediately jumps to end of the loop

B . continue - immediately jumps to next interation

C . while loop - if the number of iterations are not fixed

D . for loop - if the number of iterations are not fixed

Answer



13. Which of the following array declaration is invalid?

A . Datatype array_name[] = new DataType[size];

B . Datatype[] array_name = new DataType[size];

C . Datatype array_name[] = {val1,val2,val3,......valn};

D . Datatype array_name[] = new DataType[];

Answer



14. Do you want to access the data members of a class, you have to create ___________?

A . an object

B . a variable

C . a method

D . an array

Answer



15. In java,  the String class is comes under ___________ package?

A . javio

B . javlang

C . javutil

D . javString

Answer



16. In java,  the System class is comes under ___________ package?

A . javio

B . javlang

C . javutil

D . javString

Answer



17. In java,  the Scanner class is comes under ___________ package?

A . javio

B . javlang

C . javutil

D . javString

Answer



18. In java,  the Console class is comes under ___________ package?

A . javio

B . javlang

C . javutil

D . javString

Answer



19. Which of these is an incorrect Statement?

A . It is necessary to use new operator to initialize an array

B . Array can be initialized using comma separated expressions surrounded by curly braces

C . Array can be initialized when they are declared

D . None of the mentioned

Answer



20. In a .java file, how many numbers of public types namely class, interface or abstract can be managed?

A . 1

B . 2

C . 3

D . Any number

Answer



Fill in the Blanks


21. An ELSE or ELSE-IF statement in Java can not exist alone without IF statement(TRUE or FALSE) _________________________?

Answer


22. In Java, an array can be declared without initialization & without mentioning the size(TRUE or FALSE) ________________________

Answer


23.A local variable declared inside a method can not be used in expressions without initializing it first.(TRUE or FALSE)_________________________?

Answer


24.To successfully overload a method in Java, the argument-list or parameter-list must be ______________?

Answer


25. If you import "packagename.classname" then ___________ of this package will be acc

Answer




Relevant Materials :

Java Programming Objective Type Question Bank - [ Java Programming ]

Java Programming Objective Type Questions-Part-1 - [ Java Programming ]

Java Programming Objective Type Questions-Part-2 - [ Java Programming ]

Java Programming Objective Type Questions-Part-3 - [ Java Programming ]

Java Programming Objective Type Questions-Part-4 - [ Java Programming ]

Java Programming Objective Type Questions-Part-5 - [ Java Programming ]


Similar Materials :

Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]

Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]

Software Engineering MCQs - Unit-1 - [ SE ]

Software Engineering MCQs - Unit-2 - [ SE ]

Software Engineering MCQs - Unit-3 - [ SE ]

Software Engineering MCQs - Unit-4 - [ SE ]

Software Engineering MCQs - Unit-5 - [ SE ]

Data Mining MCQs - Unit-1 - [ DM ]

Data Mining MCQs - Unit-2 - [ DM ]

Data Mining MCQs - Unit-3 - [ DM ]

Data Mining MCQs - Unit-4 - [ DM ]

Data Mining MCQs - Unit-5 - [ DM ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]

Data Structures Objective Type Question Bank-Unit-1 - [ DS ]

Data Structures Objective Type Question Bank-Unit-2 - [ DS ]

Data Structures Objective Type Question Bank-Unit-3 - [ DS ]

Data Structures Objective Type Question Bank-Unit-4 - [ DS ]

Data Structures Objective Type Question Bank-Unit-5 - [ DS ]

Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]

Cyber Forensics Objective Type Question Bank-Part-2 - [ Cyber Forensics ]

Cyber Forensics Objective Type Question Bank-Part-1 - [ Cyber Forensics ]

Neural Networks and Deep Learning-Unit-1 Objective Type Questions - [ NNDL ]

Neural Networks and Deep Learning-Unit-2 Objective Type Questions - [ NNDL ]

Neural Networks and Deep Learning-Unit-3 Objective Type Questions - [ NNDL ]

Neural Networks and Deep Learning-Unit-4 Objective Type Questions - [ NNDL ]

Operating Systems -Unit-1 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-2 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-3 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-4 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-5 Objective Type Questions - [ Operating Systems ]

Web Technologies -Unit-1 (PHP) Objective Type Questions - [ Web Technologies ]

Web Technologies -Unit-2 (XML) Objective Type Questions - [ Web Technologies ]

Web Technologies -Unit-3 (Servlets) Objective Type Questions - [ Web Technologies ]

Web Technologies -Unit-4 (JSP) Objective Type Questions - [ Web Technologies ]