We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a7189a commit 35bd395Copy full SHA for 35bd395
src/module6/wrappers/Autoboxing.java
@@ -7,12 +7,11 @@ public class Autoboxing {
7
8
public static void main(String[] args) {
9
10
- int[] idades = new int[5];
11
- String[] nomes = new String[5];
12
-
13
int idade = 26; //Integer
14
- Integer idadeReferencia = new Integer(26);
+ Integer idadeReferencia = Integer.valueOf(26);
+
+ //Autoboxing
15
List<Integer> numeros = new ArrayList<Integer>();
16
- numeros.add(29); //Autoboxing
+ numeros.add(29);
17
}
18
src/module6/wrappers/Unboxing.java
@@ -0,0 +1,13 @@
1
+package module6.wrappers;
2
3
+public class Unboxing {
4
5
+ public static void main(String[] args) {
6
+ //Unboxing
+ int valor = idadeReferencia.intValue();
+ }
+}
0 commit comments