package test.util;
public class TesteWrapper {
public static void main(String[] args){
Integer ref = Integer.parseInt("3");
System.out.println(ref);
ref++;
System.out.println(ref);
}}
package test.util;
public class TesteWrapper {
public static void main(String[] args){
Integer ref = Integer.parseInt("3");
System.out.println(ref);
ref++;
System.out.println(ref);
}}
Regielberson,
Integer ref = Integer.parseInt("3");
Na linha acima você atribuiu a variável ref converteu para Integer o valor 3 que você passou como string. Logo, ref não é "3" e sim 3, do tipo Integer.
System.out.println(ref); //(ref=3)
ref++; //Operador Unário que atribui 1 ao valor atual
System.out.println(ref); //(ref=4)Espero ter ajudado!