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

ruby on rails - ActiveRecord order not working -

javascript - How do you prevent nested queries/catches in sequelize? -

java - ConcurrentModificationException upon committing transaction with Hibernate -