I just got help with trying to compile a jave program but now I have a new error. Can anyone help me out.?

I just got help with trying to compile a jave program but now I have a new error. Can anyone help me out.?
This is what I am trying to compile.

import java.util.Scanner;
public class Program2
{
public static void main (String[] args)
{
Scanner scan=new Scanner( System.in );
//declare and initalize a new scanner object
int num, hours, minutes, seconds;
//int x = 9733;

System.out.println(“Enter the number of seconds:9733″);

num= scan.nextlnt();
//plug entered number into num variable
hours= num/3600;
//divide entered number by 3600 to get hours
minutes= (num%3600)/60;
//take the remainder of num/3600 and divide it by 60 to get minutes
seconds= (num%3600)%60;
//take whats left for the seconds

System.out.println(num + “s=” + hours + “h,” + minutes + “m, and” + seconds +
“s”);

}
}

This is the error I am getting.

1 error

javac Program2.java
Program2.java:13: cannot find symbol
symbol : method nextlnt()
location: class java.util.Scanner
num= scan.nextlnt();
^

Best answer:

your scan.nextlnt is using the letter L so your spelling scan.Lnt not scan.Int.

Switch your L to and I and it compiles.

Tags: , , , , , , , ,

Under Forum

Leave a Comment for I just got help with trying to compile a jave program but now I have a new error. Can anyone help me out.?

You must be logged in to post a comment.

Trackback this post  |  Subscribe to the comments via RSS Feed


Categories