Retype the following and run note incorrect behavior Then fi
Solution
The required code has been written below:-
-----
//Scanner should be imported for entering the values at run time
import java.util.Scanner;
public class StarPrinter {
   
 public static void main(String[] args)
 {
 //The console asks for the values
   
    System.out.println(\"Please enter the value of numStars\");
    Scanner scan=new Scanner(System.in);
    int numStars=scan.nextInt();
   
    // the inputed value is stored in the numStars variable
   
    System.out.println(\"please enter the value of numPrinted\");
    int numPrinted=scan.nextInt();
   
    // the inputed value is stored in the numPrinted variable
   
    // the while condition checks whether the numbers entered are equal or not
   
    while(numPrinted!=numStars)
    {
          
        System.out.println(\"The Required value is :\"+numStars+\"*\");
        return;
           }
    System.out.println(\"The values given are equal please enter different values \");
    }
 }

