fork download
  1. public class Puppy{
  2.  
  3. public Puppy(String name){
  4. // Это конструктор и у него один параметр, name.
  5. System.out.println("Передаваемое имя:" + name );
  6. }
  7. public static void main(String []args){
  8. // Создание объекта myPuppy.
  9. Puppy myPuppy = new Puppy( "Багет" );
  10. }
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: class Puppy is public, should be declared in a file named Puppy.java
public class Puppy{
       ^
1 error
stdout
Standard output is empty