"cin cannot be resolved" [message #1849231] |
Sun, 09 January 2022 13:34  |
Eclipse User |
|
|
|
I am a beginner in learning java. The following simple program gives me several error messages of "cin cannot be resolved"
package testingProject;
public class MainClass {
public static void main(String[] args) {
// TODO Auto-generated method stub
double angle1, angle2, angle3;
System.out.print("Enter 1st angle: ");
angle1 = Double.parseDouble(cin.nextLine());
System.out.print("Enter 1st angle: ");
angle2 = Double.parseDouble(cin.nextLine());
System.out.print("Enter 2nd angle: ");
angle3 = 180 - angle - angle2;
System.out.println(angle3);
}
}
Error messages:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
cin cannot be resolved
cin cannot be resolved
angle cannot be resolved to a variable
at testingProject.MainClass.main(MainClass.java:10)
What should I do to fix it?
|
|
|
|
Powered by
FUDForum. Page generated in 0.08022 seconds