| | |
From beginner in Java: Atomic type-what is it?
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2007
Posts: 18
Reputation:
Solved Threads: 0
Dear all
Could you tell me what is it-atomic type in Java? I explored internet and book Java in 21 days,but nothing about it. The question was about difference between object reference and atomic type. I found that object reference is an address that indicates where an object's variable and methods are stored.
Thank you
Could you tell me what is it-atomic type in Java? I explored internet and book Java in 21 days,but nothing about it. The question was about difference between object reference and atomic type. I found that object reference is an address that indicates where an object's variable and methods are stored.
Thank you
There is no atomic "type" in Java.
All of the classes in the java.util.concurrent.atomic package have the "Atomic" prefix in their names.
All of those classes "...provide atomic access to arrays of values and provide volatile access semantics for array elements, which is not possible with the volatile modifier itself." (Java in a Nutshell 5th Edition, pg. 855)
I hope that answers your question.
All of the classes in the java.util.concurrent.atomic package have the "Atomic" prefix in their names.
All of those classes "...provide atomic access to arrays of values and provide volatile access semantics for array elements, which is not possible with the volatile modifier itself." (Java in a Nutshell 5th Edition, pg. 855)
•
•
•
•
volatile
Roughly speaking, avolatilefield is like asynchronizedmethod: safe for concurrent use by two or more threads. More accurately,volatilesays that the value of a field must always be read from and flushed to main memory, and that it may not be cached by a thread (in a register or CPU cache).
Angel-headed hipsters burning for the ancient heavenly connection, to the starry dynamo in the machinery of the night.
-Ginsburg
Don't tell me to "google it" - I already have.
-Ginsburg
Don't tell me to "google it" - I already have.
An atomic type in the context referred to most likely should be read as a primitive type.
That's int, long, double, float, byte, and char.
They don't refer to Object references, like everything else.
That's int, long, double, float, byte, and char.
They don't refer to Object references, like everything else.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
And technically primitives are stored in a different memory space from object instances (but not the references you deal with to those instances).
But they can be stored in different memory spaces depending on where and how they're created, where object instances are always created in the same space.
But they can be stored in different memory spaces depending on where and how they're created, where object instances are always created in the same space.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- Exception in thread "main" java.lang.NoClassDefFoundError: Invaders Error (Java)
- Beginner in Java: need a help (Java)
- Beginner using Java... Having trouble with javac and creation of .class files. (Java)
- full screen applet in java (Java)
- java.lang.NoSuchMethodError (Java)
- Element is undefined in a Java object of type class [Ljava.lang.String; referenced as (ColdFusion)
- need help to create a java program (Java)
- Credit card payments assignment (Java)
Other Threads in the Java Forum
- Previous Thread: Beginner in Java: need a help
- Next Thread: Query : Object creation error
Views: 2703 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for Java
3d @param affinetransform android api apple applet application arc arguments array arrays automation binary bluetooth byte c# chat class classes click client code color compare component corrupted database detection draw eclipse error event exception file fractal game givemetehcodez graphics gui guitesting helpwithhomework html ide image input integer j2me java java.xls javaprojects jmf jni jpanel julia keytool linux list loop map method methods mobile netbeans newbie number object oracle pong print problem producer program programming project projectideas read recursion reflection replaysolutions rim scanner screen server set size sms socket sort sql string swing terminal test threads time transfer tree web windows






