and class Container declared in trunk2, the following code contains a compilation error, where could it be?
package trunk1; public class Sheet { public static int pageNumber = 99; // line 1 Sheet() {} // line 2 } package trunk2; import trunk1.Sheet; public class Container { public static void main(String... args) { //line 1 System.out.print(Sheet.pageNumber); //line 2 Sheet sheet = new Sheet(); //line 3 } }
public class Sheet {
public static int pageNumber = 99; // line 1
Sheet() {} // line 2
}
package trunk2;
import trunk1.Sheet;
public class Container {
public static void main(String... args) { //line 1
System.out.print(Sheet.pageNumber); //line 2
Sheet sheet = new Sheet(); //line 3
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.