1. Classes > 
  2. Classes Revisited

Classes Revisited

Papercraft Image of Trees, Birds and Clouds Papercraft Image of Trees, Birds and Clouds1

Lets take a second look at classes. This time, rather than focusing on a single object-class, we will have several interconnected object classes, introduce class-level features and the concepts of properties and access permission.

Some of the material in this module will be review.


  1. Image Credit: https://all-free-download.com/free-vector/download/nature-background-bird-cloud-tree-icons-paper-cut_6830935.html ↩︎

6.0.0

Last modified by: Russell Feldhausen Jan 3, 2023

Computational Core Logo

  • 0. Introduction
    • 1. Course Introduction - Spring 2022
    • 2. Navigating Canvas & Codio
    • 3. Where to Find Help
    • 4. What You'll Learn
    • 5. How to Learn Programming
    • 6. CC 210 Syllabus - Spring 2023
    • 7. Plagiarism Policy
  • 0. Codio Introduction
    • 1. Welcome to Codio
    • 2. Codio Tutorials
    • 3. Codio Examples
    • 4. Codio Interface
    • 5. Important Notes
    • 6. Completing a Unit
  • 1. Object-Oriented Programming
    • 1. What is Programming?
    • 2. Running a Program
    • 3. The Software Development Lifecycle
    • 4. OOP Features
    • 5. Program Structure
    • 6. Hello World
    • 7.J Java Hello World
      • 1. History of Java
      • 2. Hello World
      • 3. Compile and Run
      • 4. Debugging
    • 8. Summary
  • 2. Data Types & Math
    • 1. The World as Data
    • 2. Variables
    • 3. Basic Data Types
    • 4. Data Types in Detail
    • 5. Arithmetic
    • 6. More on Operations
    • 7. User Input
    • 8.J Java Data Types
      • 1. Types
      • 2. Numbers
      • 3. Other Types
      • 4. Operators
      • 5. Command-Line Arguments
      • 6. Subgoals - Evaluating Expressions
      • 7. Subgoals - Writing Expressions
      • 8. Printing Text & Numbers
    • 9. Summary
  • 3. Boolean Logic
    • 1. The Laws of Thought
    • 2. Logic Operators
    • 3. Boolean Algebra
    • 4. A Worked Example
    • 5. An Alternative Approach
    • 6. Computer Circuits
    • 7.J Java Boolean Logic
      • 1. Booleans in Java
      • 2. Boolean Operators
      • 3. Subgoals Review
    • 8. Summary
  • 4. Conditionals
    • 1. Programs as Flowcharts
    • 2. Branching Constructs
    • 3. If Statements
    • 4. If-Else Statements
    • 5. Other Branching Statements
    • 6.J Java Conditional Statements
      • 1. If Statement
      • 2. If-Else Statement
      • 3. Variable Scope
      • 4. Chaining & Nesting
      • 5. Switch Statement
      • 6. Ternary Statement
      • 7. Subgoals
      • 8. A Worked Example
    • 7. Tracing & Testing Branches
    • 8. Summary
  • 5. Loops
    • 1. Wash, Rinse, Repeat
    • 2. Loop Constructs
    • 3. While Loops
    • 4 For Loops
    • 5. Loop Control
    • 6. Input Streams
    • 7.J Java Loops
      • 1. While Loop
      • 2. Do-While Loop
      • 3. For Loop
      • 4. Loop Control
      • 5. Loop Subgoals
      • 6. Input Loops
      • 7. Accumulator Pattern
      • 8. A Worked Example
    • 8. Summary
  • 6. Methods
    • 1. Writing Big Programs
    • 2. Methods
    • 3. Parameters & Arguments
    • 4. Returning a Value
    • 5. Variable Scope
    • 6. DRY: Don't Repeat Yourself
    • 7. Writing Testable Code
    • 8. Testing Your Code
    • 9.J Java Methods
      • 1. Methods
      • 2. Parameters
      • 3. Overloading
      • 4. Return
      • 5. A Worked Example
    • 10. Summary
  • 7. Objects
    • 1. Modeling the Real World
    • 2. Object-Oriented Programming
    • 3. Instance & Driver Classes
    • 4. Classes
    • 5. Object Features
    • 6. Instantiable Classes
    • 7. Driver Classes
    • 8.J Java Objects
      • 1. Instance Classes
      • 2. Objects & Initialization
      • 3. Instances & Testing
      • 4. Instance Methods
      • 5. Driver Class
      • 6. A Worked Example
      • 7. What's Next
    • 9. Summary
  • 8. Arrays
    • 1. Introduction
    • 2. Theory
    • 3. Iteration
    • 4. Call by Reference vs. Value
    • 5.J Java Arrays
      • 1. Array Creation
      • 2. Accessing Array Elements
      • 3. Array Length
      • 4. Multidimensional Arrays
      • 5. Array Operations
      • 6. Array Loops
      • 7. Array Subgoals
      • 8. A Worked Example
      • 9. A 2D Worked Example
    • 6. Summary
  • 9. Strings
    • 1. From Numbers to Text
    • 2. Characters & Strings
    • 3. Parsing Strings
    • 4. String Operations
    • 5. Formatted Strings
    • 6.J Java Strings
      • 1. Making Strings
      • 2. Parsing Strings
      • 3. String Operations
      • 4. String Formatting
      • 5. A Worked Example
    • 7. Summary
  • 10. Exceptions
    • 1. Exceptions Happen
    • 2. What is an Exception?
    • 3. Exception vs. Error
    • 4. Handling Exceptions
    • 5. Creating Exceptions
    • 6.J Java Exceptions
      • 1. Common Exceptions & Errors
      • 2. Checked vs. Unchecked Exceptions
      • 3. Try-Catch
      • 4. Throw and Throws
      • 5. Finally
      • 6. Try with Resources
      • 7. Best Practices
      • 8. A Worked Example
    • 7. Summary
  • 11. File System
    • 1. File Everything Away
    • 2. File System Basics
    • 3. Linux File System
    • 4. File System Commands
    • 5. Things to Keep in Mind
    • 6.J Java File System
      • 1. Reading Files
      • 2. Writing Files
      • 3. File Operations
      • 4. A Worked Example
    • 7. Summary
  • 12. Classes
    • 1. Classes Revisited
    • 2. Class Features
    • 3. Access Modifiers
    • 4. Properties
    • 5.J Java Classes
      • 1. Classes
      • 2. Class Attributes
      • 3. Access Modifiers
      • 4. Attributes
      • 5. Methods
      • 6. Instantiation
      • 7. Constructors
      • 8. Call by Reference
      • 9. Properties
      • 10. A Worked Example
    • 6. Summary
  • 13. Inheritance
    • 1. Shared Features in Nature
    • 2. Shared Features in Code
    • 3. Inheritance
    • 4. Polymorphism
    • 5. Overriding and Abstraction
    • 6.J Java Inheritance
      • 1. Class Inheritance
      • 2. Method Overriding
      • 3. Protected Access
      • 4. Polymorphism
      • 5. Data Type
      • 6. Abstract Classes
      • 7. Multiple Inheritance
      • 8. A Worked Example
    • 7. Summary
  • 14. Model View Controller
    • 1. Design of Everyday Things
    • 2. Software Design Patterns
    • 3. MVC Architecture
    • 4. MVP - A Type of MVC
    • 5. Model
    • 6. View
    • 7. Controller
    • 8.J Java MVC
      • 1. A Worked Example - Model
      • 2. A Worked Example - View
      • 3. A Worked Example - Controller
    • 9. Summary
  • 15. Collections
    • 1. Don't Reinvent the Wheel
    • 2. Language Libraries
    • 3. Common Features
    • 4.J Java Collections
      • 1. Documentation
      • 2. Collections
      • 3. List
      • 4. Maps
      • 5. Tuples
      • 6. Documenting Code
    • 5. Summary
  • 16. Recursion
    • 1. Introducing Recursion
    • 2. Example: Reversing a String
    • 3. Implementing Recursion
    • 4. Example: Factorials
    • 5. Tree Recursion
    • 6. Example: Fibonacci Numbers
    • 7. Example: Tower of Hanoi
    • 8. Converting Recursion to Iteration
    • 9. Recursion Summary
  • Weekly Updates
    • 1. Fall '22 Week 1
    • 1. Fall '22 Week 3
    • 1. Fall '22 Week 9
    • 1. Spring'23 Welcome
  • AP Alignment
    • 1. AP Syllabus

  •  
  •  
  •  

Built using Hugo and Hugo Relearn Theme.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. See License & Attribution for details.