JAVA unit 4

JAVA unit 4

University

10 Qs

quiz-placeholder

Similar activities

exception

exception

University

10 Qs

Round 4 - Harvest

Round 4 - Harvest

University

15 Qs

ASK F2 -KOD ARAHAN (PYTHON)

ASK F2 -KOD ARAHAN (PYTHON)

1st Grade - University

15 Qs

Ulangan harian 1 Algoritma dan Pemrograman

Ulangan harian 1 Algoritma dan Pemrograman

12th Grade - University

13 Qs

python String and comment

python String and comment

3rd Grade - University

13 Qs

Programming Standard Input

Programming Standard Input

University

10 Qs

GDSC Android Bootcamp [Kotlin Quiz]

GDSC Android Bootcamp [Kotlin Quiz]

University

10 Qs

Chapter 2 Java Basic2

Chapter 2 Java Basic2

University

10 Qs

JAVA unit 4

JAVA unit 4

Assessment

Quiz

Computers

University

Hard

Created by

Ms N Suganya CSE - 2700

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class is used to read input from the console in Java?

  • A) FileReader

  • B) BufferedReader

  • C) PrintWriter

  • D) Scanner

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to write data to a file in Java?

  • A) writeFile()

  • B) print()

  • C) write()

  • D) println()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of bounded types in generics?

  • A) To allow any type as a parameter.

  • B) To restrict the types that can be used as type arguments.

  • C) To enhance performance.

  • D) To simplify code.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define an upper bound for a generic type in Java?

  • A) super

  • B) extends

  • C) implements

  • D) restricts

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the StringBuffer class provide that the String class does not?

  • A) Immutability

  • B) Thread safety

  • C) Mutable strings

  • D) None of the above

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid declaration of a generic class in Java?

  • A) class MyClass<T> {}

  • B) class MyClass<T extends Number> {}

  • C) class MyClass<T extends Comparable<T>> {}

  • D) All of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will happen if you try to use a non-bounded type as a generic argument in a bounded generic class?

  • A) It will compile successfully.

  • B) It will throw a runtime exception.

  • C) It will cause a compile-time error.

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?