I have just started using java and I'm trying to make a simple calculator, but I'm confused as to why I keep getting a warning message.
[code=java]import java.util.Scann er;
public class Calculator {
public static void main(String[] args) {
Scanner sc=new Scanner(System. in);
System.out.prin tln("Enter first number: ");
double d1=sc.nextDoubl e();
System.out.prin tln("Enter second number: ");
double d2=sc.nextDoubl e();
}
}[/code]
it tells me that my variables d1 and d2 are never read...I have no idea what this means...can someone please help me or refer me to a good book or SOMETHING...I'm totally lost.
Thanks!
[code=java]import java.util.Scann er;
public class Calculator {
public static void main(String[] args) {
Scanner sc=new Scanner(System. in);
System.out.prin tln("Enter first number: ");
double d1=sc.nextDoubl e();
System.out.prin tln("Enter second number: ");
double d2=sc.nextDoubl e();
}
}[/code]
it tells me that my variables d1 and d2 are never read...I have no idea what this means...can someone please help me or refer me to a good book or SOMETHING...I'm totally lost.
Thanks!
Comment