Ask Question
7 October, 02:22

Write a public interface named Test with the following behavior:

a. a method getDuration that returns a Duration object.

b. a method check that accepts an int parameter and returns a Result object.

c. a method getScore that returns a double.

+2
Answers (1)
  1. 7 October, 02:40
    0
    The code to this question can be given as:

    Code:

    public interface Test / /define interface

    {

    public abstract Duration getDuration (); / /define method

    getDuration.

    public abstract Result check (int a);

    //define method

    check.

    public abstract double getScore ();

    //define method getScore.

    }

    Explanation:

    In the above code, we define an interface that is "Test" inside an interface, we define three methods that can be defined as:

    First, we define a method that is "getDuration" that method returns Duration as an object. Second, we define a method that is "check" this method accepts an integer parameter that is a and return Result. The third method is "getScore" this method will return a double value.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a public interface named Test with the following behavior: a. a method getDuration that returns a Duration object. b. a method check ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers