• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 10 pages
Exam (elaborations)

Java Programming – 80+ Practice Q&A on Greenfoot, Inheritance, Methods, Loops – CS101

Document preview thumbnail
Preview 2 out of 10 pages

This document offers 80+ exam-style Java questions with accurate, direct answers, specifically developed for the Intro to Java Programming (CS101) course using Greenfoot—a visual Java IDE popular in high school and first-year university-level programming. Tailored for the 2025/2026 academic year, it supports foundational understanding of Java syntax, object-oriented programming, and Greenfoot-based logic structures. Structured in a terminology and short-answer format, this resource is ideal for beginner-level students in Computer Science, Software Engineering, or IT, especially those using Greenfoot to explore inheritance, actors, methods, and game logic. The answers are clearly marked and written in an accessible, exam-aligned format. Key topics covered include: Greenfoot Programming Concepts: Actor, World, object placement, method overrides, turning, movement Class and Method Structure: method signatures, return types, parameters, method calling syntax Object-Oriented Design: inheritance, class instantiation, abstract classes (e.g., why Actor cannot be instantiated), use of super() Control Flow & Loops: if statements, while loops, loop conditions, infinite loops, variable counters Random Behavior: use of GRandomNumber(), simulating probabilistic behavior Arrays & Indexing: structure, access with indices, benefits of arrays Access Modifiers: difference between public and private methods String Concatenation: definition and usage in Java Boolean Logic & Comparison Operators: ==, !=, , , =, =, &&, ||, ! Debugging & Code Comments: comment types (//, /* */), rationale, and documentation use Method Abstraction & Reusability: separating logic into helper methods like lookForWorm() Compiler & Runtime Concepts: JVM, compiler, bytecode, class instantiation Crab & Worm Simulation Logic: sample conditional behaviors such as collision detection, turning, and interaction in Greenfoot This document is especially suitable for: High school AP Computer Science A or IB Computer Science students using Greenfoot University students in CS101 courses with Greenfoot-based labs or assignments Tutors building Java quizzes around visual logic simulation New Java learners needing structured revision on OOP through a visual IDE Self-learners using Greenfoot as a first step into Java programming Its highly practical format mirrors real-world classroom and assignment questions in both Java and Greenfoot contexts, offering a complete, beginner-friendly Java Q&A bank. Keywords: Greenfoot Java, Java inheritance, Greenfoot actor, Java method signature, Greenfoot worm crab, Java random number, Java for loop, Java access modifier, Java arrays, Java comments, Java boolean logic, Java method call, CS101 Java, Java public private, Java object-oriented

Content preview

Java Test 2025/2026 Exam Questions
with 100% Correct Answers | Latest
Update



Define signature and a body - 🧠ANSWER ✔✔Signature: Method that

contains the return type, parameters and name

Body: Lines between the open and closed curly brackets

Formal name for the integer inside the parentheses - 🧠ANSWER

✔✔Argrument


Explain inheritance & how it relates to the crab class - 🧠ANSWER ✔✔To

pass methods from a superclass to a subclass. It uses methods from the

actor class

Difference between calling a method with a void return type vs a non-void

return type - 🧠ANSWER ✔✔Void: Will not return any values

, Non-void: Will return a value


Write a method signature for the crab class - 🧠ANSWER ✔✔Public void

crabMove();

What is the purpose of having a class called Actor if you cannot make an

instance of it? - 🧠ANSWER ✔✔Provides a template that all actors can use


Why cant you right-click an Actor class and make an instance of it? -

🧠ANSWER ✔✔Actor is an abstract class in which you cannot create an

instance

Method name for: Public void addAmount(intamount);




Return value type for: Public void play();




How many parameters for: Public void compare(int x, int y, int z); -

🧠ANSWER ✔✔Method name: addAmount


Return value type: void

Parameters: 3

Document information

Uploaded on
September 29, 2025
Number of pages
10
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$15.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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
JOSHCLAY
3.6
(87)
Sold
405
Followers
16
Items
20795
Last sold
11 hours ago



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