repl.it
@Freer/

OO Review

Java

No description

fork
loading
Files
  • Main.java
  • Car.java
Main.java
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
class Animal{
  boolean isEating;
  String gender;
  double weightInPounds;
  //fields
  public Animal(boolean isEating, 
  String gender, double weightInPounds){
    //a constructor
    this.isEating = isEating;
    this.gender = gender;
    this.weightInPounds = weightInPounds;
  }

}

class Dog extends Animal{
  String breed, name;
  int ageYears;
  public Dog(boolean isEating, String gender,
  double wp, String breed, String name,
  int a){
    super(isEating, gender, wp);
    this.breed = breed;
    this.name = name;
    this.ageYears = a;
  }
}













class Main {
  public static void main(String[] args) {
    System.out.println("Hello world!");
  }
}
Fetching token
?