aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Concepts
  • When a method is declared as private, it can be accessed ...
Multiple choice

When a method is declared as private, it can be accessed from its

  1. class

  2. subclass

  3. package

  4. anywhere

  5. all of the above

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

When the access specifier is private, it can only be accessed in the class in which it is defined.

Keep practicing — related questions

  • When a method is declared as public, it can be accessed from its
  • If a method is declared as protected, where may the method be accessed?
  • Can a private method of a super class be declared in a sub class?
  • Superclass methods with this level of access cannot be called from subclasses
  • What does the access modifier "private" mean?
  • We would like to make a member of a class visible in all subclasses regardless of what package they are in....
  • A method is declared as protected. What classes can access this method? (Choose two. Each option is a corre...
  • We would like to make a member of a class visible in all subclasses regardless of what package they are in....
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Object-Oriented Programming (2239 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy