Search Header Logo

JAVA Concepts

Authored by JAYABHARATHI P

Others

KG

Used 1+ times

JAVA Concepts
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these keywords is not a part of exception handling?


try

finally

thrown

catch

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class exception_handling

  2. {

  3. public static void main(String args[])

  4. {

  5. try

  6. {

  7. System.out.print("Hello" + " " + 1 / 0);

  8. }

  9. catch(ArithmeticException e)

  10. {

  11. System.out.print("World");

  12. }

  13. }

  14. }


  1. Hello

  1. World

  1. HelloWorld

  1. Hello World

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java program?

  1. class exception_handling

  2. {

  3. public static void main(String args[])

  4. {

  5. try

  6. {

  7. int a, b;

  8. b = 0;

  9. a = 5 / b;

  10. System.out.print("A");

  11. }

  12. catch(ArithmeticException e)

  13. {

  14. System.out.print("B");

  15. }

  16. finally

  17. {

  18. System.out.print("C");

  19. }

  20. }

  21. }

A

B

AC

BC

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which principle allows different classes to be treated as instances of the same class through inheritance?

Encapsulation

Abstraction

Inheritance

Polymorphism

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, what concept allows us to implement runtime polymorphism?

Method overloading

Method overriding

Constructors

Static methods

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these allows compile-time polymorphism?

Method overloading


Method overriding

Both

None of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In which scenario does Java NOT allow polymorphism?

When overriding private methods

When using the method overloading

When using interface methods

When using abstract methods

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?