Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #9801
| From | Nagrik <vnagrik@gmail.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Can you use "synchronized" for data members |
| Date | 2011-11-09 10:32 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <9b72bb98-97ce-46da-8f08-a9ed74440638@d37g2000prg.googlegroups.com> (permalink) |
Hello Group,
Can the "synchronized" kew word be used in front of data members. I
am aware that it can be used in fron of methods, and a block.
Something like this.
public class myclass {
synchronized prinvate int counter; // Is it allowed
}
If the answer is yes then in what situation it is adviseable.
Thanks in advance..
nagrik
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Can you use "synchronized" for data members Nagrik <vnagrik@gmail.com> - 2011-11-09 10:32 -0800
Re: Can you use "synchronized" for data members markspace <-@.> - 2011-11-09 10:40 -0800
Re: Can you use "synchronized" for data members Tom Anderson <twic@urchin.earth.li> - 2011-11-09 22:02 +0000
Re: Can you use "synchronized" for data members Patricia Shanahan <pats@acm.org> - 2011-11-09 14:07 -0800
Re: Can you use "synchronized" for data members Joshua Maurice <joshuamaurice@gmail.com> - 2011-11-09 17:09 -0800
csiph-web