Westonci.ca is the Q&A platform that connects you with experts who provide accurate and detailed answers. Join our platform to connect with experts ready to provide precise answers to your questions in different areas. Get quick and reliable solutions to your questions from a community of experienced experts on our platform.

Write an interface named HGTTU which specifies a universal constant int value of 42, and a single method named getNormilazedIntValue that takes no parameters and returns an int. The purpose of which is to get the value of the object's int instance variable, add the universal constant and return the result.Next, write a second named myInt which is composed of a single int instance variable (and the minimal set of customary methods) that implements HGTTU.

Sagot :

Answer:

Hope this helps.

//HGTTU.java

public interface HGTTU {

 int universalConstant = 42;

  public int getNormilazedIntValue();

}

//MyInt.java

public class MyInt implements HGTTU {

  int instanceFiled;

Override

  public int getNormilazedIntValue() {

      return instanceFiled+universalConstant;

  }

}

Explanation: