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

Java application game of life, The game of Life, invented by John Conway, i...

The game of Life, invented by John Conway, is supposed to model the genetic laws for birth, survival, and death (see Scienti_c American, October 1970, p. 120). We will play it on a

Padovan series, write a program in java using array and scanner class to ge...

write a program in java using array and scanner class to generate padovan series

Aspect oriented programming (aop), Aspect-Oriented  Programming  (AOP)  rep...

Aspect-Oriented  Programming  (AOP)  represents  OOP  (Object  Oriented  Programming)  by  giving  the developer to dynamically change the static OO model to make a system that can

Eclipse javaj, how to write coding for money and currency

how to write coding for money and currency

Clean up for java programs, You have recently joined a games company. The S...

You have recently joined a games company. The SQA manager has given you the task of improving the code quality of simple games. This is a standard task which the SQA manager gives

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Method over ridding method in java, Q. Write short on the method over riddi...

Q. Write short on the method over ridding method in java? Ans. Method over ridding and dynamic binding: We have seen that a method in a super class is inherited by its subclass

Socket Programming, Task back to top Write a JAVA GUI program that would f...

Task back to top Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA soc

What are the steps of working of tcp and ip protocols, What are the steps o...

What are the steps of working of TCP and IP protocols within internet transmission? TCP divide messages in several packets (capsulation) and sent these messages over the internet

Dropbox calendar, code in dropbox calendar and loop for feruary leapyear

code in dropbox calendar and loop for feruary leapyear

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