The problem with the packages. The main folder: http://image.prntscr.com/image/4d767d9e4f44452eb962984d59ec7fa2.png

File code "1":

import mainpackage.*; class MainClass { public static void main (String[] s){ SeparationClass o = new SeparationClass(); for(int i=1; i<=8; ++i){ for(int j=1; j<=8; ++j){ o.setA(i); o.setB(j); System.out.print(o.deduct() + " "); } System.out.println(); } } } 

in the main folder http://image.prntscr.com/image/19c8976c0525489ab65dcbefca4e8847.png

File code "2":

 package myfirstpackage; class SeparationClass { private int a; private int b; SeparationClass () {a = 0;b = 0;} public void setA(int a) {this.a = a;} public void setB(int b) {this.b = b;} public int deduct() {return a - b;} } 

When compiling produces an error: http://image.prntscr.com/image/66c07183f0b14704bfabc65529861b82.png

Please explain where the error is.

  • one
    photos can be downloaded right here. do not be shy .. and make a mistake as a quote : Alexey Shimansky
  • Try renaming the file package 2 with myfirstpackage -> mainpackage - a.chugunov
  • It did not help. Error compiling 1.java - j6wj1997
  • Solved a problem. - j6wj1997

0