Site icon DataFlair

Quiz on Java Static Binding Vs Dynamic Binding

quiz on java static binding vs dynamic binding

Get Job-ready: Java Course with 45+ Real-time Projects! - Learn Java

In the realm of Java object-oriented programming (OOP), mastering static and dynamic binding is akin to wielding a magician’s wand. These powerful concepts determine how methods are invoked at runtime, playing a critical role behind the scenes.

This interactive quiz serves as your training ground, where you’ll be challenged to conjure your knowledge of static and dynamic binding. By answering these thought-provoking questions, you’ll not only test your understanding but also uncover areas for further exploration.

The journey to becoming a Java master begins here – so step up, take the quiz, and solidify your grasp of static vs. dynamic binding!

Time limit: 0

Quiz Summary

0 of 15 Questions completed

Questions:

Information

You have already completed the quiz before. Hence you can not start it again.

Quiz is loading…

You must sign in or sign up to start the quiz.

You must first complete the following:

Results

Quiz complete. Results are being recorded.

Results

0 of 15 Questions answered correctly

Your time:

Time has elapsed

You have reached 0 of 0 point(s), (0)

Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)

Categories

  1. Not categorized 0%
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  1. Current
  2. Review / Skip
  3. Answered
  4. Correct
  5. Incorrect
  1. Question 1 of 15
    1. Question

    When the type of object creation and method invocation is done at the execution time it is called as ?

    Correct
    Incorrect
  2. Question 2 of 15
    2. Question

    class Binding {

    public void method {

    System.out.println(‘DataFlair”);

    }

     }

    class Main {

    public static void main ( String args [ ] )

    {

    Binding obj = new Binding();

    obj.method();

    }

    }

    The given program is a sample of which of the following ?

    Correct
    Incorrect
  3. Question 3 of 15
    3. Question

    class Inheritance {

    public void show()

    {

    System.out.println(“DataFlair webservices”);

    }

    }

    class Main {

    public static void main ( String args [ ] )

    {

    Inheritance object = new Inheritance();

    object.show();

    }

    }

    What will be the output of the program ?

    Correct
    Incorrect
  4. Question 4 of 15
    4. Question

    When all the methods cannot be overridden, which type of binding can be used for it ?

    Correct
    Incorrect
  5. Question 5 of 15
    5. Question

    Which of the following is the correct syntax of dynamic binding in Java ?

    Correct
    Incorrect
  6. Question 6 of 15
    6. Question

    class Sample {

    public void show()

    {

    System.out.println(“Static binding sample”);

    }

    }

    class Example {

    public void show()

    {

    System.out.println(“Dynamic binding sample”);

    }

    }

    class Main {

    public static void main ( String args [ ] )

    {

    Sample s = new Sample();

    s.show();

    }

    }

    What is the output of the program ?

    Correct
    Incorrect
  7. Question 7 of 15
    7. Question

    Which of the following will be helpful to perform dynamic binding ?

    Correct
    Incorrect
  8. Question 8 of 15
    8. Question

    class Inheritance {

    public void print()

    {

    System.out.println(“Inheritance is not used”);

    }

    }

    class Base {

    public void print()

    {

    System.out.println(“Inheritance is used”);

    }

    }

    class Main {

    public static void main ( String args [ ] )

    {

    Inheritance i = new Base();

    i.print();

    }

    }

    What is the output of the program ?

    Correct
    Incorrect
  9. Question 9 of 15
    9. Question

    class First {

    void Display( string a)

    {

    System.out.println(a);

    }

    }

    class Second extends First {

    void Display( )

    {

    System.out.println(a);

    }

    }

    class Main {

    public static void main ( String args [ ] )

    {

    First obj = new Second();

    obj.Display(“DataFlair”);

    }

    }

    What is the error in the program ?

    Correct
    Incorrect
  10. Question 10 of 15
    10. Question

    Dynamic binding is possible in which of the following ?

    Correct
    Incorrect
  11. Question 11 of 15
    11. Question

    class A {

    public void disp() 

    {

    System.out.println(“Class A method”);

    }

    }

    class B  {

    public void disp()

    {

    System.out.println(“Class B method”);

    }

    }

    class Main {

    public static void main ( String args [ ] )

    {

    A a = new A();

    B a = new B();

    a.disp();

    }

    }

    What will be the output of the program ?

    Correct
    Incorrect
  12. Question 12 of 15
    12. Question

    class Demo {

    public void show( String a)

    {

    System.out.println(a);

    }

    }

    class Main {

    public static void main ( String args [ ] )

    {

    Demo obj = new Demo();

    obj.show(“DataFlair”);

    }

    }

    What is the output of the program ?

    Correct
    Incorrect
  13. Question 13 of 15
    13. Question

    Which type of binding should be used for classes containing final methods ?

    Correct
    Incorrect
  14. Question 14 of 15
    14. Question

    class Dynamic {

    int Text()

    {

    System.out.println(“Example for Static binding”);

    }

    }

    class Static extends Dynamic {

    int Text()

    {

    System.out.println(“Example for Dynamic binding”);

    }

    }

    class Main {

    public static void main ( String args [ ] )

    {

    Dynamic object = new Static();

    object.Text();

    }

    }

    What is the output of the program ?

    Correct
    Incorrect
  15. Question 15 of 15
    15. Question

    Which of the following is the correct syntax for static binding in Java ?

    Correct
    Incorrect

Summary:

You’ve just completed the Java Static Binding vs. Dynamic Binding Quiz! This quiz assessed your understanding of how method calls are resolved at compile time (static binding) or runtime (dynamic binding). By reviewing both your correct and incorrect answers, you can gain valuable insights into your strengths and weaknesses in this essential domain.

Remember, effective learning is an ongoing process. Explore additional resources beyond the quiz, such as tutorials and practice problems. Solidify your understanding of static and dynamic binding to become a more proficient Java programmer.

Exit mobile version