100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

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

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
29-09-2025
Written in
2025/2026

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

Show more Read less
Institution
JAVA
Course
JAVA









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
JAVA
Course
JAVA

Document information

Uploaded on
September 29, 2025
Number of pages
10
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

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

Get to know the seller

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 West Governors University
View profile
Follow You need to be logged in order to follow users or courses
Sold
210
Member since
2 year
Number of followers
14
Documents
17146
Last sold
22 hours ago
JOSHCLAY

JOSHCLAY EXAM HUB, WELCOME ALL, HERE YOU WILL FIND ALL DOCUMENTS & PACKAGE DEAL YOU NEED FOR YOUR SCHOOL WORK OFFERED BY SELLER JOSHCLAY

3.7

39 reviews

5
16
4
7
3
8
2
4
1
4

Recently viewed by you

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

Frequently asked questions