What is wrong with this?
import java.io.*;
class TUI{
public static void main(String[] args) {
System.out.println("Enter the two numbers:");
int n1=readInt("Enter n1:");
int n2=readInt("Enter n2:");
int total=n1+n2;
System.out.println("Total is =" + total+".");
}
}
Getting these errors
Day2.java:5: error: cannot find symbol
int n1=readInt("Enter n1:");
^
symbol: method readInt(String)
location: class TUI
Day2.java:6: error: cannot find symbol
int n2=readInt("Enter n2:");
^
symbol: method readInt(String)
location: class TUI
PS- Also What is the difference between readInt
and nextInt
?
Can I use nextInt
here