Quiz Discussion

Which of this keyword must be used to inherit a class?

Course Name: Java

  • 1]

    super

  • 2]

    this

  • 3]

    extent

  • 4]

    extends

Solution
No Solution Present Yet

Top 5 Similar Quiz - Based On AI&ML

Quiz Recommendation System API Link - https://fresherbell-quiz-api.herokuapp.com/fresherbell_quiz_api

# Quiz
1
Discuss

In order to restrict a variable of a class from inheriting to subclass, how variable should be declared?

  • 1]

    Protected

  • 2]

    Private

  • 3]

    Public

  • 4]

    Static

Solution
2
Discuss

Using which of the following, multiple inheritance in Java can be implemented?

  • 1]

    Interfaces

  • 2]

    Multithreading

  • 3]

    Protected methods

  • 4]

    Private methods

Solution
3
Discuss

 A class member declared protected becomes a member of subclass of which type?

  • 1]

    public member

  • 2]

    private member

  • 3]

    protected member

  • 4]

    static member

Solution
4
Discuss

Which of these is correct way of inheriting class A by class B?

  • 1]

    class B + class A {}

  • 2]

    class B inherits class A {}

  • 3]

    class B extends A {}

  • 4]

    class B extends class A {}

Solution
5
Discuss

Static members are not inherited to subclass.

  • 1]

    True

  • 2]

    False

Solution
6
Discuss

Which of the following is used for implementing inheritance through an interface?

  • 1]

    inherited

  • 2]

    using

  • 3]

    extends

  • 4]

    implements

Solution
7
Discuss

What would be the result if a class extends two interfaces and both have a method with same name and signature? Lets assume that the class is not implementing that method.

  • 1]

    Runtime error

  • 2]

    Compile time error

  • 3]

    Code runs successfully

  • 4]

    First called method is executed successfully

Solution
8
Discuss

What is not type of inheritance?

  • 1]

    Single inheritance

  • 2]

    Double inheritance

  • 3]

    Hierarchical inheritance

  • 4]

     Multiple inheritance

Solution
9
Discuss

Which of the following is used in implementing inheritance through class?

  • 1]

    inherited

  • 2]

    using

  • 3]

    extends

  • 4]

    implements

Solution
10
Discuss

Does Java support multiple level inheritance?

  • 1]

    True

  • 2]

    False

Solution
# Quiz