what should be public what should be privateas a


What should be public? What should be private?

As a rule of thumb:

  1. Classes are public.
  2. Fields are private.
  3. Constructors are public.
  4. Getter and setter methods are public.
  5. Other methods must be decided on a case by case basis.

All of these rules might be freely violated if you have a purpose for doing so. These are simply the defaults in which handle 90 percent of the cases.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: what should be public what should be privateas a
Reference No:- TGS0284587

Expected delivery within 24 Hours