You are on page 1of 4

Republic of the Philippines a) Polymorphism

b) Inheritance
DEPARTMENT OF EDUCATION c) Compilation
d) Encapsulation
REGION VIII 9. What is not the use of “this” keyword in Java?
a) Referring to the instance variable when a local
DIVISION OF SAMAR variable has the same name
BASEY NATIONAL HIGH SCHOOL b) Passing itself to the method of the same class
Basey, Samar c) Passing itself to another method
d) Calling another constructor in constructor
JAVA PROGRAMMING chaining
(Senior High School) 10. Which of the following is a type of polymorphism
FIRST QUARTER EXAMINATION in Java Programming?
a) Multiple polymorphism
S.Y. 2022 – 2023 b) Compile time polymorphism
c) Multilevel polymorphism
d) Execution time polymorphism
11.  What is Truncation in Java?
DIRECTION: Choose the Correct answer 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
1. Who invented Java Programming? d) Integer value assigned to floating type
a) Guido van Rossum 12. What is the extension of compiled java classes?
b) James Gosling a) .txt
c) Dennis Ritchie b) .js
d) Bjarne Stroustrup c) .class
2. Which statement is true about Java? d) .java
a) Java is a sequence-dependent programming 13. Which exception is thrown when java is out of
language memory?
b) Java is a code dependent programming a) MemoryError
language b) OutOfMemoryError
c) Java is a platform-dependent programming c) MemoryOutOfBoundsException
language d) MemoryFullException
d) Java is a platform-independent programming 14. Which of these are selection statements in Java?
language a) break
3. Which component is used to compile, debug and b) continue
execute the java programs? c) for()
a) JRE d) if()
b) JIT 15.  Which of these keywords is used to define
c) JDK interfaces in Java?
d) JVM a) intf
4. Which one of the following is not a Java feature? b) Intf
a) Object-oriented c) interface
b) Use of pointers d) Interface
c) Portable 16. Which of the following is a superclass of every
d) Dynamic and Extensible class in Java?
5. Which of these cannot be used for a variable a) ArrayList
name in Java? b) Abstract class
a) identifier & keyword c) Object class
b) identifier d) String
c) keyword 17. Which of the below is not a Java Profiler?
d) none of the mentioned a) JProfiler
6.  What is the extension of java code files? b) Eclipse Profiler
a) .js c) JVM
b) .txt d) JConsole
c) .class 18. Which of these packages contains the exception
d) .java Stack Overflow in Java?
7.  Which environment variable is used to set the a) java.io
java path? b) java.system
a) MAVEN_Path c) java.lang
b) JavaPATH d) java.util
c) JAVA 19. Which of these statements is incorrect about
d) JAVA_HOME Thread?
8. Which of the following is not an OOPS concept in a) start() method is used to begin execution of the
Java? thread
b) run() method is used to begin execution of a
thread before start() method in special cases 27.  _____ is used to find and fix bugs in the Java
c) A thread can be formed by implementing programs.
Runnable interface only
d) A thread can be formed by a class that extends
Thread class a. JVM
20. Which of these keywords are used for the block to
be examined for exceptions? b. JRE
a) check
b) throw c. JDK
c) catch
d) try d. JDB
21. Which one of the following is not an access
modifier?
a) Protected 28.  Which of the following is a valid declaration of a
b) Void
c) Public char?
d) Private
22. What is the numerical range of a char data type in
a) char ch = '\utea';
Java?
a) 0 to 256
b) char ca = 'tea';
b) -128 to 127
c) 0 to 65535
c) char cr = \u0223;
d) 0 to 32767
23. Which class provides system independent server d) char cc = '\itea';
side implementation?
a) Server
b) ServerReader 29. What is the return type of the hashCode() method
c) Socket
d) ServerSocket in the Object class?
24. Which of the following option leads to the
portability and security of Java?
a. Object
a) Bytecode is executed by JVM
b. int
b) The applet makes the Java code secure and
c. long
portable

c) Use of exception handling d. void

d) Dynamic binding between objects


30. Which of the following is a valid long literal?
25. Which of the following is not a Java features?

a) Dynamic a) ABH8097

b) Architecture Neutral b) L990023

c) Use of pointers c) 904423

d) Object-oriented d) 0xnf029L

26. The \u0021 article referred to as a 31. What does the expression float a = 35 / 0 return?

a) Unicode escape sequence a) 0

b) Octal escape b) Not a Number

c) Hexadecimal c) Infinity

d) Line feed d) Run time exception

32. Evaluate the following Java expression, if x=3, y=5, and


z=10:
++z + y - y + z + x++
a. Serialization

a)24 b)23 b. Variable Shadowing

c) 20 d) 25 c. Abstraction

d. Multi-threading
33. Which of the following tool is used to generate
API documentation in HTML format from doc
comments in source code? 38. Which of the following is true about the anonymous

inner class?
a. javap tool

b. javaw command a. It has only methods

c. Javadoc tool b. Objects can't be created

d. javah command c. It has a fixed class name

d. It has no class name


34.. Which of the following creates a List of 3

visible items and multiple selections abled? 39.  Which package contains the Random class?

a. new List(false, 3) a. java.util package

b. new List(3, true) b. java.lang package

c. new List(true, 3) c. java.awt package

d. new List(3, false) d. java.io package

35. Which of the following for loop declaration is 40. What do you mean by nameless objects?
not valid?
a. An object created by using the new keyword.
a. for ( int i = 99; i >= 0; i / 9 )
b. An object of a superclass created in the subclass.
b. for ( int i = 7; i <= 77; i += 7 )
c. An object without having any name but having a
c. for ( int i = 20; i >= 2; - -i ) reference.

d. for ( int i = 2; i <= 20; i = 2* i ) d. An object that has no reference.

36. Which method of the Class.class is used to

determine the name of a class represented by the

class object as a String? 41. An interface with no fields or methods is known as a

______.
a. getClass()
a. Runnable Interface
b. intern()
b. Marker Interface
c. getName()
c. Abstract Interface
d. toString()
d. CharSequence Interface
37.  In which process, a local variable has the same

name as one of the instance variables?


42.  Which of the following is an immediate subclass of the 47. Which of the following is a marker interface?

Panel class?
a. Runnable interface

a. Applet class b. Remote interface

b. Window class c. Readable interface

c. Frame class d. Result interface

d. Dialog class
48. Which of the following is a reserved keyword in Java?

43. Which of these classes are the direct subclasses of


a. object
the Throwable class?
b. strictfp
a. RuntimeException and Error class
c. main
b. Exception and VirtualMachineError class
d. system
c. Error and Exception class
49. Which keyword is used for accessing the features of a
d. IOException and VirtualMachineError class
package?

44. What do you mean by chained exceptions in Java?


a. package

a. Exceptions occurred by the VirtualMachineError b. import

b. An exception caused by other exceptions c. extends

c. Exceptions occur in chains with discarding the d. export


debugging information
50. In java, jar stands for_____.
d. None of the above

a. Java Archive Runner


45. In which memory a String is stored, when we create a
b. Java Application Resource
string using new operator?
c. Java Application Runner

a. Stack d. None of the above

b. String memory

c. Heap memory

d. Random storage space

46. What is the use of the intern() method?

a. It returns the existing string from memory

b. It creates a new string in the database

c. It modifies the existing string in the database

d. None of the above

You might also like