Java Programming Language Fundamentals

419 questions in the bank
Are you ready to take quiz?
Explore more
Logo
About the Quiz

Quiz will ask 20 randomly selected questions with allotted time of . You can take the quiz more than once. Once you submit the quiz, you can review how you have done, the correct the answers for each questions and the explanation for the correct the answer.

Quiz Topics

9 Modules

Java Frameworks

6 topics
1.

Dependency Injection

0 questions
2.

Hibernate (ORM)

0 questions
3.

JavaServer Faces (JSF)

0 questions
4.

Microservices with Spring Boot

0 questions
5.

RESTful Web Services

0 questions
6.

Spring Framework (Core, MVC, Boot)

0 questions

Java Development Tools

6 topics

Design Patterns

5 topics

Java 8 Features

6 topics

Java I/O

6 topics

Java Concurrency

6 topics

Java Collections Framework

6 topics

Object-Oriented Programming (OOP)

6 topics

Core Java Concepts

6 topics
Sample questions

What will be the output of the following code?

int[] arr = {1, 2, 3, 4, 5};
System.out.println(arr[5]);

1

ArrayIndexOutOfBoundsException

5

Compilation Error

Which of the following statements about arrays in Java are true?

Arrays can hold primitive types and objects.

The size of an array is fixed after it is created.

Arrays in Java are zero-indexed.

You can change the size of an array dynamically.

What will be the output of the following code?

int[] arr = new int[5];
for(int i = 0; i < arr.length; i++) {
    arr[i] = i * 2;
}
System.out.println(arr[2]);

0

1

2

4

Which of the following methods can be used to copy an array in Java?

System.arraycopy()

Arrays.copyOf()

clone()

copy()

What is the result of the following code?

int[] arr = {1, 2, 3};
int[] arr2 = arr;
arr2[0] = 10;
System.out.println(arr[0]);

1

2

3

10

Quiz Topics

9 Modules

Java Frameworks

6 topics
1.

Dependency Injection

0 questions
2.

Hibernate (ORM)

0 questions
3.

JavaServer Faces (JSF)

0 questions
4.

Microservices with Spring Boot

0 questions
5.

RESTful Web Services

0 questions
6.

Spring Framework (Core, MVC, Boot)

0 questions

Java Development Tools

6 topics

Design Patterns

5 topics

Java 8 Features

6 topics

Java I/O

6 topics

Java Concurrency

6 topics

Java Collections Framework

6 topics

Object-Oriented Programming (OOP)

6 topics

Core Java Concepts

6 topics