Skip to content

Adds typecasting, primitives, variable name, and fixes issue #32 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Tristan-Raz
Copy link
Contributor

Enhanced Variable Declaration Section:
Added details on valid variable naming conventions in Java, including rules and the use of camelCase.
Included an explanation of how Java automatically allocates memory for primitive types, clarifying why operations on them are fast.

Added Primitive Type Casting:
Introduced explanations and code examples for both implicit (widening) and explicit (narrowing) casting between primitive types like int and double.

Added New Section for Class Type Casting:
Created a new subsection titled "Type Casting with Classes (Objects)" to explain casting within an inheritance hierarchy.
Uses a simple Animal/Dog example to demonstrate upcasting (subclass to superclass) and downcasting (superclass to subclass).
Introduces the instanceof operator as a best practice for performing safe downcasts and avoiding ClassCastException.

Removes subsection of IO as Logan is moving that to a separate section.

Copy link
Collaborator

@pearcej pearcej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tristan-Raz What happened to the Input / Output / Scanner subsection?

@Tristan-Raz
Copy link
Contributor Author

@pearcej Logan is making a section about Input/ Output/ Scanner and libraries. He asked me to remove it so that he would not create a merge conflict. Do you want me to add it back?

@pearcej
Copy link
Collaborator

pearcej commented Jul 29, 2025

@pearcej Logan is making a section about Input/ Output/ Scanner and libraries. He asked me to remove it so that he would not create a merge conflict. Do you want me to add it back?

Sorry. I missed that comment in the original description. Let's wait until I get his pull request.

@pearcej pearcej merged commit 1324a5f into RunestoneInteractive:master Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants