Code.org Blog Post

Code.org with up to lesson 15 completed

image

Code.org Key Learnings

  • In Java, an object can be created using the public objectName(){} command.
  • An object is an instance of a class, and it has its own identity, state, and purpose. The state of an object is stored in variables or fields, and it can be used using functions or methods.
  • In Java, the public class subclassName extends superclassName{} command links a subclass to a superclass. An example of subclassName could be soccer, while an example of superclassName could be sport.
  • A sub class that extends to a super class means that the sub class is inherited from the super class.
  • A Java constructor is a method used to initialize objects that does not have a return type (e.g. void). The constructor name must be the same as its class name counterpart. Every class has by default a constructor, and a constructor is called whenever an object is built. An example of a Java constructor code is public Main(){}.