SOLVED REQUESTING LOCK
hi, im zunon im 13 yrs old and im learning java, while reading the book :
Java: a beginners guide fifth edition i stumbled upon the same error twice:
when I copy the code shown in the book and try to compile them I get an error in javac but when I copy and paste the exact same code from the file from the website it compiles and runs perfectly, I tried to spot and eliminate every difference I find in the 2 texts can you help me and find the differences I couldn't find?
My version of the code:
the supplied one from the book:Code:/*
This program illustrates the differences
between int and double.
Call this file Example3.java
*/
class Example3 {
public static void main(String args[]) {
int var; // this declares an int variable
double x; // this declares a floating-point variable
var = 10; // assign var the value 10
x = 10.0; // assign x the value 10.0
System.out.printIn("Original value of var: " + var);
System.out.printIn("Original value of x: " + x);
System.out.printIn(); // print a blank line
// now, divide both by 4
var = var / 4;
x = x / 4;
System.out.printIn("var after division: " + var);
System.out.printIn("x after division: " + x);
}
}
Code:/*
This program illustrates the differences
between int and double.
Call this file Example3.java.
*/
class Example3 {
public static void main(String args[]) {
int var; // this declares an int variable
double x; // this declares a floating-point variable
var = 10; // assign var the value 10
x = 10.0; // assign x the value 10.0
System.out.println("Original value of var: " + var);
System.out.println("Original value of x: " + x);
System.out.println(); // print a blank line
// now, divide both by 4
var = var / 4;
x = x / 4;
System.out.println("var after division: " + var);
System.out.println("x after division: " + x);
}
}

