Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #6945

Re: Getters and Setters

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail
From "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Getters and Setters
Date Tue, 09 Aug 2011 22:11:01 -0400
Organization The Wasteland
Lines 18
Message-ID <nospam-F05222.22110109082011@news.aioe.org> (permalink)
References <79c811c0-8eec-4c87-8027-2bc971818278@l9g2000prd.googlegroups.com>
NNTP-Posting-Host LQJtZWzu+iKlBROuDg+IUg.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)
X-Notice Filtered by postfilter v. 0.8.2
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6945

Show key headers only | View raw


In article 
<79c811c0-8eec-4c87-8027-2bc971818278@l9g2000prd.googlegroups.com>,
 Vikram <vpradhan33@gmail.com> wrote:

> Why do we use getter and setters if we can do the same work by 
> declaring the public data members. Your answer will be appreciable.

In "Effective Java, Second Edition," Joshua Bloch elaborates on this in 
"Item 13: Minimize the accessibility of classes and members." 
Accessibility, mutability, security and thread-safety are among the 
topics covered.

<http://java.sun.com/docs/books/effective/>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Getters and Setters Vikram <vpradhan33@gmail.com> - 2011-08-09 18:59 -0700
  Re: Getters and Setters "John B. Matthews" <nospam@nospam.invalid> - 2011-08-09 22:11 -0400
  Re: Getters and Setters Arne Vajhøj <arne@vajhoej.dk> - 2011-08-09 22:37 -0400
  Re: Getters and Setters Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-09 23:30 -0400
    Re: Getters and Setters Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-08-10 06:34 -0300
  Re: Getters and Setters Roedy Green <see_website@mindprod.com.invalid> - 2011-08-09 21:50 -0700

csiph-web