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.

Respuesta :

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: