Java Programming

Java Programming

University

10 Qs

quiz-placeholder

Similar activities

Java Exception Handling

Java Exception Handling

University

15 Qs

Quizz Programación 2

Quizz Programación 2

University

15 Qs

Conhecimentos prévios em Programação Orientada a Objetos

Conhecimentos prévios em Programação Orientada a Objetos

11th Grade - University

10 Qs

CSE_A1_QUIZ 6(15-05-23)

CSE_A1_QUIZ 6(15-05-23)

University

13 Qs

Java Quiz1

Java Quiz1

University

10 Qs

Java Quiz 4

Java Quiz 4

University

15 Qs

CSC 200 L7 Assessment

CSC 200 L7 Assessment

University

10 Qs

Quis 1-Teori PJV

Quis 1-Teori PJV

University

10 Qs

Java Programming

Java Programming

Assessment

Quiz

Computers

University

Hard

Created by

SUMATHI A

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

  1. Which of the following is not a primitive data type in Java?

int        

float           

String         

Boolean

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. What is the purpose of encapsulation?

To hide the implementation details of a class.

To make code more efficient.

To increase code complexity.

d

To reduce code readability.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

 3. Which of the following is a conditional statement in Java?

while

if-else 

for

do-while

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output?

int x = 10;

  1. while (x > 0) {

    System.out.println(x);

    x--;

}

10 9 8 7 6 5 4 3 2 1

1 2 3 4 5 6 7 8 9 10

10 9 8 7 6 5 4 3 2

Infinite loop

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. What are the two main types of exceptions in Java?

Compile-time and runtime exceptions.

Checked and unchecked exceptions.

Logical and syntax exceptions.

Input and output exceptions.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6.What is the purpose of BufferedReader in Java?

                    

To convert bytes into characters

To read data from a file byte by byte 

  1. To read data from a file line by line

  1. To read data from a file line by line

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. What is the purpose of packages in Java?

To provide a mechanism for accessing classes from different packages.

To handle exceptions in Java.

To define methods for handling input/output operations.

To group related classes and interfaces together.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?