There are 2 classes of DogTestDrive and Dog. The class Dog is in the folder pets
import pets.Dog; public class DogTestDrive{ public static void main(String[] args) throws Exception { Dog d = new Dog(); System.out.println(d.name); } } and
public class Dog { public String name = "Шарик"; System.out.println(name); } I compile through the command line - swears on System.out.println in the class Dog. 
do not understand why? If you comment out this line of output in the Dog class, everything works.