ITI COPA Java MCQ [PDF] 130 Most important Questions

ITI COPA Java MCQ Questions and Answers with PDF. Most important java programming language MCQs for ITI Students 2023 Online CBT Exam paper preparation. These are the new Questions provided by DGT from the New Syllabus that is updated in 2022.

ITI COPA Java MCQ

1. Number of primitive data types in Java are ____

a) 6     

b) 7     

c) 8     

d) 9

Ans. c

2. What is the size of float and double in java?

a) 32 and 64   

b) 32 and 32

c) 64 and 64   

d) 64 and 32

Ans. a

3. Automatic type conversion is possible in which of the following cases?

a) Byte to int

b) Int to long

c) Long to int

d) Short to int

Ans. b

4. Find the output of the following code.

int Integer = 24;

char String  = ‘I’;

System.out.print(Integer);

System.out.print(String);

a) Compiler error

b) Throws exception

c) I

d) 24 I

Ans. d

5. Select the valid statement to declare and initialize an array.

a) int[] A = {}

b) int[] A = {1, 2, 3}

c) int[] A = (1, 2, 3)

d) int[][] A = {1, 2, 3}

Ans. b

6. Arrays in java are –

a) Object references

b) Objects

c) Primitive data type

d) None

Ans. b

7. When is the object created with new keyword?

a) At run time                        

b) At compile time

c) Depends on the code         

d) None

Ans. a

8. Identify the correct definition of a package.

a) A package is a collection of editing tools

b) A package is a collection of classes

c) A package is a collection of classes and interfaces

d) A package is a collection of interfaces

Ans. c

9. compareTo() returns

a) True

b) False

c) An int value

d) None

Ans. c

10. To which of the following does the class string belong to

a) java.lang

b) java.awt

c) java.applet

d) java.string

Ans. a

11. How many objects will be created in the following?

String a = new String(“Interviewbit”);

String b = new String(“Interviewbit”);

Strinc c = “Interviewbit”;

String d = “Interviewbit”;

a) 2

b) 3

c) 4

d) None

Ans. b

12. Total constructor string class have

a) 3     

b) 7     

c) 13   

d) 20

Ans. c

13. Find the output of the following code.

if(1 + 1 + 1 + 1 + 1 == 5){

  System.out.print(“TRUE”);

}

else{

  System.out.print(“FALSE”);

}

a) TRUE          

b) FALSE         

c) Compile error        

d) None

Ans. a

14. Identify the return type of a method that does not return any value.

a) int

b) void

c) double

d) None

Ans. b

15. Where does the system stores parameters and local variables whenever a method is invoked?

a) Heap

b) Stack

c) Array

d) Tree

Ans. b

16. Identify the modifier which cannot be used for constructor.

a) public

b) protected

c) private

d) static

Ans. d

17. When is the finalize() method called?

a) Before garbage collection

b) Before an object goes out of scope

c) Before a variable goes out of scope

d) None

Ans. a

18. Identify the infinite loop

a) for(; 😉

b) for(int i = 0; i < 1; i–)

c) for(int i = 0; ;i++)

d) All of the above

Ans. d

19. What is Runnable?

a) Abstract class         

b) Interface    

c) Class                       

d) Method

Ans. b

20. Exception created by try block is caught in which block

a) catch

b) throw

c) final

d) none

Ans. a

21. Where is System class defined?

a) java.lang.package

b) java.util.package

c) java.io.package

d) None

Ans. a

22. Which of the following statements are true about finalize() method?

a) It can be called Zero or one times

b) It can be called Zero or more times

c) It can be called Exactly once

d) It can be called One or more times

Ans. a

23. Which one of the following is not an access modifier?

a) Protected

b) Void

c) Public

d) Private

Ans. b

24. Which environment variable is used to set the java path?

a) MAVEN_Path

b) JavaPATH

c) JAVA

d) JAVA_HOME

Ans. d

25. Which of the following is not an OOPS concept in Java?

a) Polymorphism

b) Inheritance

c) Compilation

d) Encapsulation

Ans. c

26. Which of the following is a type of polymorphism in Java Programming?

a) Multiple polymorphism

b) Compile time polymorphism

c) Multilevel polymorphism

d) Execution time polymorphism

Ans. b

27. What is Truncation in Java?

a) Floating-point value assigned to a Floating type

b) Floating-point value assigned to an integer type

c) Integer value assigned to floating type

d) Integer value assigned to floating type

Ans. b

28. What is the extension of compiled java classes?

a) .txt

b) .js

c) .class

d) .java

Ans. c

29. Which exception is thrown when java is out of memory?

a) MemoryError

b) OutOfMemoryError

c) MemoryOutOfBoundsException

d) MemoryFullException

Ans. b

30. Which of the following is a superclass of every class in Java?

a) ArrayList

b) Abstract class

c) Object class

d) String

Ans. c

31. Which of the below is not a Java Profiler?

a) JProfiler

b) Eclipse Profiler

c) JVM

d) JConsole

Ans. c

32. Which of these packages contains the exception Stack Overflow in Java?

a) java.io       

b) java.system

c) java.lang   

d) java.util

Ans. c

33. Which of these keywords are used for the block to be examined for exceptions?

a) check          

b) throw         

c) catch          

d) try

Ans. d

34. What is the numerical range of a char data type in Java?

a) 0 to 256

b) -128 to 127

c) 0 to 65535

d) 0 to 32767

Ans. c

35. Which class provides system independent server side implementation?

a) Server

b) ServerReader

c) Socket

d) ServerSocket

Ans. d

36. Which of the following option leads to the portability and security of Java?

a) Bytecode is executed by JVM

b) The applet makes the Java Code secure and portable

c) User of exception handling

d) Dynamic binding between objects

Ans. a

37. Which of the following is not a Java features?

a) Dynamic

b) Architecture Neutral

c) Use of pointers

d) Object-oriented

Ans. c

38. Which of the following is a valid long literal?

a) ABH8097

b) L990023

c) 904423

d) 0xnf029L

Ans. d

39. Which of the following tool is used to generate API documentation in HTML format from doc comments in source code?

a) javap tool               

b) javaw command

c) javadoc tool                       

d) javah command

Ans. c

40. Which of the following creates a List of 3 visible items and multiple selections abled?

a) new List(false, 3)   

b) new List(3, true)

c) new List(true, 3)     

d) new List(3, false)

Ans. b

ITI COPA Java MCQ PDF Download
ITI COPA Book PDF Free Download [Hindi/English] 2023
ITI COPA Cloud Computing MCQ [PDF] 50 Important Question
ITI COPA Database Concepts MCQ [PDF] 70 important Question
WhatsApp Channel Join Now
Telegram Channel Join Now
Instagram Page Join Now