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