What should be public and private, JAVA Programming

Assignment Help:

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.


Related Discussions:- What should be public and private

Time date millis method, I neeed to create a basic code to do the following...

I neeed to create a basic code to do the following. the class is entry level and I would appreciate a brief explanation as to why you do each bit. Write a program that displays t

Define high-level thread states?, The state chart diagram given below defin...

The state chart diagram given below defines the thread states.     1.      Runnable - waiting for its turn to be picked for performing by the thread scheduler based o

What is application context module, The Application context module makes sp...

The Application context module makes spring a framework. This module extends the concept of BeanFactory, giving support for internationalization (I18N) messages, application lifecy

Create a fifa coins website, Project Description: I want to create simil...

Project Description: I want to create similar site: fifacointrader I want similar site like fifacointrader.com Skills required are HTML, Java, PHP, Website Design, Wordpre

Explain final fields, Explain final fields ? You may also declare field...

Explain final fields ? You may also declare fields to be final. This is not the similar thing as declaring a method or class to be final. While a field is declared final, it is

Javaserver faces event and listener model, What is JavaServer Faces event a...

What is JavaServer Faces event and listener model? Ans) A mechanism for verifying how events emitted by JavaServer Faces UI components are handled. This model is based on the Ja

Determine the meaning of finalize, Determine the meaning of finalize W...

Determine the meaning of finalize When  a  finalize method  is  defined  in  a  class,  Java  run  time  calls  finalize() whenever  it's  about  to  recycle  an object  of  t

Implement a driver program to test out all constructors, Implement a class ...

Implement a class  Book  (Book.java). A book will have three instance variables: a  title  (a String, for example: "Big Java" or "The Hitchhiker's Guide to the Galaxy"), an  author

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd