This site requires JavaScript, please enable it in your browser!
Greenfoot back
RShock
RShock wrote ...

2019/12/11

Would like some assistance with questions

RShock RShock

2019/12/11

#
Hello everyone, I am new to Greenfoot and had missed one of my computer science classes. My teacher put three do now questions on the board, and I would like some assistance with those. 1) Calling a method with a void return type is equivalent to giving a ______________________. Calling a method with a non-void return type is equivalent to _________________________________________________. 2) When if - statements are evaluated the condition can only be __________________ or _________________. The if - statement will be executed only when the condition is _________________. 3) In the Java hierarchical structure what is the formal name of the class that passes methods to its subclasses? Thanks!
RShock RShock

2019/12/11

#
Also, I would like to know if the three access control modifiers would be public/private/protected, or public/private/default. Appreciate the help!
danpost danpost

2019/12/11

#
In your initial post, what do you think the answers are? In your second post, default is not an access type.
RShock RShock

2019/12/11

#
Here are the answers that I am considering, but are unsure of 1. Void return type - Giving a command Non void return type - Asking a question 2. I am genuinely unsure of this one, and would like an explanation... 3. Subclass extends superclass Thank you for the quick response
danpost danpost

2019/12/11

#
I would totally agree with (1a) -- "Giving a command". I would also agree with (1b) -- "Asking a question", but only in the case that the returned value is of the boolean type (true or false). The return type could be a value or an object, as well. Therefore, I would say it would be "Getting data" or "Fetching information". I, also, was not present during your instruction time and cannot be sure as to what your instructor might have in mind here. For (2), if you look at it in its entirety, it will be apparent. (Hint: think "logically") Your answer to (3) is the linking between two classes and has something to do with the question, but you were asked for the formal name of a class (one class answer -- not two).
RShock RShock

2019/12/11

#
Alright, so here is what I have: 2. When if - statements are evaluated the condition can only be true or false. The if - statement will be executed only when the condition is true. 3. Superclass
You need to login to post a reply.