javaide icon indicating copy to clipboard operation
javaide copied to clipboard

Problem while coding

Open VivekAmbegaonkar opened this issue 3 years ago • 1 comments
trafficstars

package Cwh; import java.util.Scanner;

public class examplenumber5 {

public static void main(String[] args) { System.out.println("enter the integer value"); Scanner sc = new Scanner(System.in);

System.out.println(sc hasNextInt()); } } In above code hasNextInt is not working,it shows an error while running this code please solve it for me....!

VivekAmbegaonkar avatar Feb 02 '22 16:02 VivekAmbegaonkar

It has to be sc.hasNextInt() and not sc hasNetInt()

PranavPurwar avatar Feb 03 '22 04:02 PranavPurwar