Multiple choice

Which of the following is not a return type?

  1. boolean

  2. void

  3. public

  4. Button

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In Java, 'public' is an access modifier (controls visibility), not a return type. Return types specify what data type a method returns: void (returns nothing), boolean (returns true/false), or any class type like Button. Access modifiers like public, private, protected are separate concepts that specify who can access the method, not what it returns.