java - get() vs intValue() methods in AtomicInteger -


atomicinteger class has 2 methods, get() , intvalue() following definitions.

intvalue() definition :

/**  * returns value of {@code atomicinteger} {@code int}.  */ public int intvalue() {     return get(); } 

get() definition:

/**  * gets current value.  *  * @return current value  */ public final int get() {     return value; } 

is there advantage of having non final method intvalue()? practical purposes, can use method if not wrong. please explain if there advantage such practice.

the method intvalue() exists because atomicinteger extends number, abstract.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -