Frequently asked questions

Q1) What is wrong with the following class declaration:

   private class someClass{
         // class implementation goes here
   }

A) There are no private classes. Classes can be public or default. Public is public, while default is like being private within its own package.

Q2) What is encapsulation?

A) Encapsulation is how we contain our variables, code, and methods in a manner that exposes just the parts and functionality we want to other code.

Get Android Programming for Beginners - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.