Compiling error: Return type for the method is missing

You need to use the name of your class in constructor:

public StoreRatioNumberClass(int newNum, int newDen) {
       //...

otherwise compiler will think you are about to declare a method and is confused about the missing return type obviously

Leave a Comment