Notes

Data Types

  • In data types, there are both Primitive Types in Java and Wrapper Classes.
  • To identify if a data type is primitive or not, you must check its capitalization.
    • Primitive types will not be capitalized (for example: int, boolean, char, byte, long) whereas Wrapper Classes will be capitalized (for example: Int, Double, Boolean, String)

Primitive Data Input

  • Uses the java scanner for console input Input For Primitive Types

Primitive Data Output

  • Descriptions of the mathematical operations combine to form result of the operation.
  • Primitive types usually aren’t alone and will have primitive type doubles and/or wrapper class double.

Java Objects (Code.org Key Learnings)

  • can create a new object without using variables
  • import the java scanner along with whatever else you need to create certain functions
  • 2D array seen in java objects notebook with the color names in one column (1D), and the color codes in the other column (another 1D)
  • static means its not part of the object
    • just in the class definition
  • static public void main(String[] args)
    • used to drive a class
  • new Menu();
    • contains while loop within it to restart the menu until we quit the program with the 0 input
  • The extends feature in java is used to extend a class in order for the subclass (child) to inherit from the superclass (parent)
  • To create a new object: specify the class name, followed by the object name, and use the keyword new
  • use main.java
  • Use constructors to initialize objects and set some object attributes
    • constructors can have as many parameters as needed

Graphic User Interface (GUI)

  • can inherit properties from another
  • color is once again being randomized
  • seeing usage of frame.set, frame.add to show use of java objects
    • dot notation is the referencing of object