'Method Call With parameter

this week in my college class we started our chapter on Method Calls and i'm having trouble with it. This is the activity we have in class: Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. Ex: myPrinter.printFeetInchShort(5, 8) prints: 5' 8" Hint: Use " to print a double quote. This is what I have so far, I don't know if i'm doing it right because i've been having trouble with method calling:

import java.util.Scanner;

public class HeightPrinter {

   public static void printFeetInchShort(int numFeet, int numInches) {
      System.out.println(numFeet + "" + numInches + "\"");
      

   public static void main (String [] args) {
      HeightPrinter myPrinter = new HeightPrinter();

      // Will be run with (5, 8), then (4, 11)
      myPrinter.printFeetInchShort(5, 8);
      System.out.println("");
   }

}



Solution 1:[1]

public static void printFeetInchShort(int numFeet, int numInches) { System.out.print(numFeet + "' " + numInches + """);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user18238091