Search Header Logo

ieee

Authored by Rekha Patil

Engineering

University

Used 3+ times

ieee
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is true about abstract classes?

Abstract class can have both abstract and non-abstract methods

) Abstract class can be instantiated directly

Abstract class cannot have constructors

Abstract class must contain only abstract methods

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to override a method in Java with a lower access modifier (e.g., protected → private)?

Works fine

Compile-time error

Runtime error

ignored

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about static blocks in Java is correct?

A class can have only one static block

Static blocks execute only when objects are created

Static blocks execute before the main method

Static blocks cannot modify static variables

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about method overloading in Java?

Methods must have different names

Methods must have different return types

Methods must have different parameter lists

Methods must belong to different classes

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

class A{

A(){System.out.println("Constructor A");}

}

class B extends A{

B(){System.out.println("Constructor B");}

}

class C extends B{

C(){System.out.println("Constructor C");}

public static void main(String args[]){

new C();

}

}

Constructor A

Constructor B

Constructor C

Constructor A

Constructor C

Constructor B

Constructor A

Constructor B

Constructor C

Constructor B

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?