@nabbit123/

project#15

Java

No description

fork
loading
Files
  • Main.java
  • Bird.class
  • Bird.java
  • Dog.class
  • Dog.java
  • Main.class
  • Pet.class
  • Pet.java
  • Snake.class
  • Snake.java

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6340094409293309","path":"Main.java","file":{"path":"Main.java","content":{"asEncoding":{"base64":"cHVibGljIGNsYXNzIE1haW4KewogICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgIC8vICBJbnN0YW50aWF0ZXMgYSBkb2cgYW5kIGEgc25ha2Ugb2JqZWN0IGFuZCBwcmludHMgaW5mb3JtYXRpb24KICAgLy8gIGFib3V0IHRoZW0uCiAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpCiAgIHsKICAgICAgRG9nIGZpZG8gPSBuZXcgRG9nKCJGaWRvIiwgNDUpOwogICAgICBTbmFrZSBzYW0gPSBuZXcgU25ha2UoIlNhbSIsIDMwKTsKICAgICAgQmlyZCBqb2huID0gbmV3IEJpcmQoIkpvaG4iLCAxOSk7CiAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihmaWRvKTsKICAgICAgU3lzdGVtLm91dC5wcmludGxuKGZpZG8uZ2V0TmFtZSgpICsgIiBzYXlzICIgKyBmaWRvLnNwZWFrKCkpOwogICAgICBTeXN0ZW0ub3V0LnByaW50bG4oZmlkby5tb3ZlKCkgKyAiICIgKyBmaWRvLmdldE5hbWUoKSArICIgIiArIGZpZG8ubW92ZSgpKTsKICAgICAgU3lzdGVtLm91dC5wcmludGxuKCk7CiAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihzYW0pOwogICAgICBTeXN0ZW0ub3V0LnByaW50bG4oc2FtLmdldE5hbWUoKSArICIgc2F5cyAiICsgc2FtLnNwZWFrKCkpOwogICAgICBTeXN0ZW0ub3V0LnByaW50bG4oc2FtLm1vdmUoKSArICIgIiArIHNhbS5nZXROYW1lKCkgKyAiICIgKyBzYW0ubW92ZSgpKTsKICAgICAgU3lzdGVtLm91dC5wcmludGxuKCk7CiAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihqb2huKTsKICAgICAgU3lzdGVtLm91dC5wcmludGxuKGpvaG4uZ2V0TmFtZSgpICsgIiBzYXlzICIgKyBqb2huLnNwZWFrKCkpOwogICAgICBTeXN0ZW0ub3V0LnByaW50bG4oam9obi5tb3ZlKCkgKyAiICIgKyBqb2huLmdldE5hbWUoKSArICIgIiArIGpvaG4ubW92ZSgpKTsKICAgfQp9Cg=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public class Main
{
   //-----------------------------------------------------------------
   //  Instantiates a dog and a snake object and prints information
   //  about them.
   //-----------------------------------------------------------------
   public static void main (String[] args)
   {
      Dog fido = new Dog("Fido", 45);
      Snake sam = new Snake("Sam", 30);
      Bird john = new Bird("John", 19);
      System.out.println(fido);
      System.out.println(fido.getName() + " says " + fido.speak());
      System.out.println(fido.move() + " " + fido.getName() + " " + fido.move());
      System.out.println();
      System.out.println(sam);
      System.out.println(sam.getName() + " says " + sam.speak());
      System.out.println(sam.move() + " " + sam.getName() + " " + sam.move());
      System.out.println();
      System.out.println(john);
      System.out.println(john.getName() + " says " + john.speak());
      System.out.println(john.move() + " " + john.getName() + " " + john.move());
   }
}