Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 2 out of 9 pages
Class notes

Java Fundamentals & OOP Workbook: CSCE 145 Syntax, Classes & Objects

Document preview thumbnail
Preview 2 out of 9 pages

The ultimate study guide for baseline Java code operations and foundational Object-Oriented Programming (OOP) designs. Core Chapters Covered:Program Basics & I/O: Class declarations, entry points, and reading console interactions via Scanner. Data Structures & Operators: Primitive data types, reference types, integer division, and tracking compound boolean expressions. Control Flow & Loops: Deciphering if/else ladders, switch blocks, and fixed for loops vs. conditional while/do-while loops. Methods & Arrays: Creating reusable logic routines and managing arrays with loops. Class Design & OOP Foundations: Data encapsulation via private scopes, tracking this references, generating custom parameterized constructors, accessors (getters), and mutators (setters with validation). Memory Architecture: Demystifying references, garbage collection rules, and identifying the structural root causes of NullPointerExceptions. OOP Methods & Extras: Method overloading rules, implementing custom equals() and toString() formats, and basic enumerations (enum). Features an extensive Class-Design Walkthrough (The Wheel Class) skeleton project and a comprehensive Answer Key explaining code compilation responses and memory tracking.

Content preview

PRE MI UM ACT I VE- LE A RN IN G WO RK BOO K




Java Fundamentals & Object-Oriented
Programming
CSCE 145 Notes — Syntax, Control Flow, Classes & Objects


Computer Science • Active-Learning Edition




How to use this workbook
1. Read the concept explanation. 2. Study the worked example. 3. Try the practice problems yourself.
4. Check your work against the Answer Key. 5. Revisit anything you missed.

, 1. Program Basics
● Every Java file = one class. Execution always starts in the main method.

CODE
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

✏ TRY IT YOURSELF
1. Write a Main class that prints your name to the console.




2. Input & Output
Term Definition
System.out.println() Prints a message and moves to a new line.
System.out.print() Prints a message without a new line.
Scanner Used for reading user input: sc.nextInt(), sc.nextDouble(), sc.next(), sc.nextLine().

✏ TRY IT YOURSELF
1. Write code that asks the user for their age (an int) and prints "You are __ years old."




3. Variables & Data Types
Term Definition
byte Whole numbers, -128 to 127.
short Whole numbers, -32,768 to 32,767.
int Whole numbers, about ±2.1 billion.
long Very large whole numbers (±9.2 quintillion).
float Fractional numbers, ~6-7 decimal digits precision.
double Fractional numbers, ~15 decimal digits precision.
boolean true or false.
char A single character or Unicode value.
String / arrays / objects Reference types (not primitives).

WORKED EXAMPLE — Declaration vs Initialization
int age; // declare only
age = 20; // initialize
int year = 2025; // both at once

✏ TRY IT YOURSELF

Document information

Uploaded on
July 11, 2026
Number of pages
9
Written in
2025/2026
Type
Class notes
Professor(s)
Jeremiah shepherd
Contains
All classes
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
9
Last sold
-


Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions