code.org Unit 1
Takeaways from Code.org Unit 1
// Creating a class
public class MyNeighborhood {
public static void main(String[] args) {
// Creating an Object
Painter myPainter = new Painter();
// calling a method using dot notation
myPainter.move();
myPainter.turnLeft();
}
}
// Extend a superclass to the subclass
// A.K.A. Inheritance
public class PainterPlus extends Painter {
public PainterPlus() {
super();
}
}
// Formatting for inheritance
public class subclass extends superclass {
// code here
}