Programming Java: Pass object into static method?

New object a of the class Auto_ created => a.output(); doesn't output anything to the console. Why not? => System.out.println(a) calls toString(). That's it! => Auto_.getsOut(a) works. This is a static method and is passed to an object of the class Auto_ (here Auto_ auto). Why does this work here now, that I can call…

Compare Java strings with == and .equals?

A string is a class in Java. New string objects or reference variables can be easily created by assignment String str3 = "iwas"; String str4 = "iwas" instead of String strx = new String("…"); str3 und str4 sind doch nun zwei verschiedene Referenzvariablen. With str3.equals(str4) you compare the contents of the strings. True, of course!…

Java println()?

In line 15 I put an integer into the …println method The 400 is converted to a string using String.valueOf and then output. This works. In line 16 …println(c.setHubraum(600)) I get an error because of void because the method set.Displacement in the class Car has no return value. public void set.Displacement(int displacement){ this.displacement = displacement;…