Java Module Test&QUIZ
Java Module Test&QUIZ
)
BAPUJI INSTITUTE OF ENGINEERING AND TECHNOLOGY, DAVANGERE-577 004
DEPARTMENT OF MASTER OF COMPUTER APPLICATIONS
Course Outcome Statements : After the successful completion of the course, the students will be able to
CO1 Understand the basic principles of the object-oriented programming.
CO2 Demonstrate an introductory understanding of graphical user interfaces, Types of Inheritance.
CO3 Apply the knowledge of Java concepts to find the solution for a given problem.
CO4 Analyze the given Java application for correctness/functionalities.
CO5 Develop Java programs/application for a given requirement.
Q. No. Question M L C
Which statement is true about Java?
a) Java is a sequence-dependent programming language 1 1
1 b) Java is a code dependent programming language 1
c) Java is a platform-dependent programming language
d) Java is a platform-independent programming language
Which one of the following is not a Java feature?
a) Object-oriented 1 1 1
2 b) Use of pointers
c) Portable
d) Dynamic and Extensible
What will be the output of the following Java code?
class increment { 1 1 1
public static void main(String args[]){
int g = 3;
3
System.out.print(++g * 8);
}
}
a) 32 b) 33 c) 24 d) 25
What will be the output of the following program?
int[][] matrix = { 1 1 1
{1, 2, 3},
{4, 5, 6},
4 {7, 8, 9}
};
System.out.println(matrix[1][2]);
a) 4 b) 5
c) 6 d) 9
What happens if you access an invalid index of an array in Java?
5 a) ArrayIndexOutOfBoundsException b) NullPointerException 1 1 1
c) Segmentation Fault d) No Error
6 What will be the output of the following Java program?
1 1 1
class output {
public static void main(String args[])
{
double a, b, c;
a = 3.0/0;
b = 0/4.0;
c=0/0.0;
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
Bapuji Educational Association (Regd.)
BAPUJI INSTITUTE OF ENGINEERING AND TECHNOLOGY, DAVANGERE-577 004
DEPARTMENT OF MASTER OF COMPUTER APPLICATIONS
}
a) NaN b) Infinity c) 0.0 d) All of the mentioned
How can one constructor call another constructor within the same class?
7 a) Using super() b) using this() 1 1 1
c) Using new() d) Constructors cannot call each other
What happens when finalize () is called on an object?
a) The object is immediately garbage collected. b)The garbage collector calls it 1 1 1
8 before collecting the object c) The object gets permanently deleted from
memory
d) It prevents an object from being collected.
Arrays in java are-
9 a) Object reference b) Objects 1 1 1
c) Primitive data types d) None
Which keyword is used to define a constant variable in Java?
10 a) final b) static 1 1 1
c) const d) immutable