1. Who invented Java Programming?
a. Guido van Rossum
b. James Gosling
c. Dennis Ritchie
d. Bjarne Stroustrup
2. Java was developed by _____________________.
a. Sun MicroSystem
b. Microsoft
c. Oracle
d. IBM
3. Java language was initially called as
a. Sumatra
b. J++
c. Oak
d. Pine
4. JDK stands for ________________.
a. Java development kit
b. Java deployment kit
c. JavaScript deployment kit
d. None of these
5. JRE stands for _________________
a. Java run ecosystem
b. JDK runtime Environment
c. Java Runtime Environment
d. None of these
6. JAR in Java stands for _______________.
a. Java Archive
b. Java application runtime
c. Java application runner
d. None of these
7. Which statement is true about Java?
a. Java is a sequence-dependent programming language
b. Java is a code dependent programming language
c. Java is a platform-dependent programming language
d. Java is a platform-independent programming language
8. Object in java are __________.
a. Classes
b. References
c. Iterators
d. None of these
9. Which component is used to compile, debug and execute the java programs?
a. JRE
b. JIT
c. JDK
d. JVM
10. What is the full form of JVM?
a. Java Very Large Machine
b. Java Verified Machine
c. Java Very Small Machine
d. Java Virtual Machine
11. _________ is a software that interprets Java bytecode.
a. Â Java virtual machine
b. Java Compiler
c. Java Debugger
d. Java API
12. Which one of the following is not a Java feature?
a. Object-oriented
b. Use of pointers
c. Portable
d. Dynamic and Extensible
13. Â ________ is Architecture-Neutral.
a. Java
b. C++
c. C
d. Ada
14. On which platforms Java runs?
a. Windows
b. Mac OS
c. UNIX
d. All of these
15. What makes the Java platform independent?
a. Advanced programming language
b. It uses bytecode for execution
c. Class compilation
d. All of these
16. Which of the following is not an OOPs concept in Java?
a. Polymorphism
b. Inheritance
c. Compilation
d. Encapsulation
17. Java object-oriented programming concepts is/are
a. Encapsulation
b. Inheritance
c. Polymorphism
d. All of the above.
18. Java compiler translates Java source code into _______.
a. Java bytecode
b. machine code
c. assembly code
d. another high-level language codes
19. What is byte code in Java?
a. Code generated by a Java compiler
b. Code generated by a Java Virtual Machine
c. Name of Java source code file
d. Block of code written inside a class
20. The extension name of a Java source code file is _________.
a. .java
b. .obj
c. .class
d. .exe
21. The extension name of a Java bytecode file is _________.
a. .java
b. .obj
c. .class
d. .exe
22. Command to compile a class in the file Test.java is ________.
a. java Test
b. java Test.java
c. javac Test.java
d. javac Test
23. ________ is used to find and fix bugs in the Java programs.
a. JVM
b. JRE
c. JDK
d. JDB
24. Which of these components are used in a Java program for compilation, debugging, and execution?
a. JDK
b. JVM
c. JRE
d. JIT
25. Which of these cannot be used for a variable name in Java?
a. identifier & keyword
b. identifier
c. keyword
d. none of the mentioned
26. Multiline comment is created using __________.
a. //
b. /* */
c. <!– — >
d. All of these
27. Every statement in Java ends with ____________.
a. a semicolon (;)
b. a comma (,)
c. a period (.)
d. an asterisk (*)
28. What is the entry point of a program in Java?
a. main() method
b. The first line of code
c. Last line of code
d. main class
29. All Java applications must have a method _______________.
a. public static Main(String[] args)
b. public static Main(String args[])
c. public static void main(String[] args)
d. public void main(String[] args)
30. Number of primitive data types in Java are?
a. 6
b. 7
c. 8
d. 9
31. _________data type requires the most amount of memory.
a. long
b. int
c. short
d. byte
32. Java supports both Primitive & Non-Primitive (User Defined) datatypes. Which one of the following is not a primitive datatype?
a. Byte
b. Short
c. Long
d. Class
33. What is the extension of java code files?
a. .js
b. .txt
c. .class
d. .java
34. What is the extension of compiled java classes?
a. .txt
b. .js
c. .class
d. .java
35. Which of the following is the correct syntax to create a variable in Java?
a. var name;
b. int name;
c. var name int;
d. All of these
36. To assign a value 1 to variable x, you write_________
a. 1 = x;
b. x = 1;
c. x := 1;
d. 1 := x;
37. Which class in Java is used to take input from the user?
a. Scanner
b. Input
c. Applier
d. None of these
38. Method used to take a string as input in Java?
a. next()
b. nextLine()
c. Both A. and B.
d. None of these
39. Which operator is used for logical “AND” operation?
a. &&
b. &
c. ||
d. |
40. Identify the return type of a method that does not return any value
a. int
b. void
c. double
d. none
41. Which of these are selection statements in java
a. break
b. continue
c. for()
4. if()
42. Which of these selection statements test only for equality?
a. If
b. Switch
c. if & switch
d. none of the mentioned
43. The break statement in Java is used to ___________.
a. Terminates from the loop immediately
b. Terminates from the program immediately
c. Skips the current iteration
d. All of these
44. Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
a. do-while
b. while
c. for
d. none of the mentioned
45. Array in java is ___________.
a. Collection of similar elements
b. Collection of elements of different types
c. The data type of consisting of characters
d. None of these
46. Which of these operators is used to allocate memory to array in Java?
a. alloc
b. malloc
c. new malloc
d. new
47. Which of these are Access Modifiers in java?
a. Default
b. Public
c. Protected
d. All of these
48. Which of these is a non-access modifier?
a. Public
b. Private
c. Native
d. All of these
49. Select the valid statement.
a. char[] ch = new char(5)
b. char[] ch = new char[5]
c. char[] ch = new char()
d. char[] ch = new char[]
50. What will be the output of the following program?
public class test {
public static void main(String args[]) {
   int arr[]={1,2,3,4,5};
   for(int i=0;i<arr.length-1;i++)
   {
       System.out.print(arr[i] + ” “);
   }
}
}
a. 1 2 3 4 5
b. 1 2 3 4
c. 1 2
d. 1 2 3