I am new to Java
I wrote a code to find largest number

import java.util.Scanner;

public class LargestNumber
{
 public static void main( String args[] ) 
  {
     int number,largestNumber;
	  
     Scanner input = new Scanner( System.in );
	  
	  System.out.print( "Enter 10 numbers to compare" );
	  
	  for( int counter = 1 ; counter <= 10; counter++)//conter initialises
	  {
	     number = input.nextint();//number input from user
		
		if(largestNumber < number)
		{ largestNumber = number; }//assigning largest number
		}
		 System.out.printf("The Largest Number is: ",largestNumber );
   }
	  
} // end class LargestNumber

I have error

LargestNumber.java:19: cannot find symbol
symbol : method nextint()
location: class java.util.Scanner
number = input.nextint();//number input from user
^
1 error


What is the problem? please help.

Capitalization matters in Java. Look up that function in the API.

yes!! nextint should be nextInt.
i found it.
Thanks Ezzaral

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.