aspose file tools*
The moose likes Beginning Java and the fly likes how public data member manipulated by outside world Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how public data member manipulated by outside world" Watch "how public data member manipulated by outside world" New topic
Author

how public data member manipulated by outside world

Abdullah mohammad
Greenhorn

Joined: Feb 22, 2013
Posts: 3


please can some one give an example in which public data member of a class is manipulated by outside world
directly.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3969
    
  17

The java.awt.Point class (see API) has two public data members, x and y. You can directly manipulate them like this:


Steve
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36579
    
  16
Welcome to the Ranch
Look up the java.awt.Point class. Or java.awt.GridBagConstraints.
Of course, it is usually regarded as poor design to have public fields, unless they are constants. Point and GridBagConstraints do not escape being bad.
Abdullah mohammad
Greenhorn

Joined: Feb 22, 2013
Posts: 3
Steve Luke wrote:The java.awt.Point class (see API) has two public data members, x and y. You can directly manipulate them like this:



thank you Steve
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how public data member manipulated by outside world
 
Similar Threads
Is Ruby easier to learn than Java, since there appears to be less code to write?
Passed SCBCD 5.0
Opening a jPanel Form in jFrame form using NetBeans IDE
Problem with Devakas Final Exam Q on Static Thread methods
WA #1.....word association