Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Pascal Surget
Added: Sep 12, 2018 12:47 PM
Views: 6
Detection automatique du type primitif de l'objet.
  1. public class Main {
  2. public static void main(String args[]) {
  3.    Integer iOb = 60, iOb2; // autobox an int
  4.    int i = iOb; // auto-unbox
  5.    System.out.println(i + " " + iOb);
  6.    iOb2 = iOb+(iOb/3);
  7.   System.out.println(i + " " + iOb2);
  8.  }
  9. }