Created
July 6, 2016 03:45
-
-
Save ucchyocean/133c736a4c53f9b0223cfc524afd825a to your computer and use it in GitHub Desktop.
基本データ型とボクシング型の違い
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
public class BoxingTester { | |
public static void main(String[] args) { | |
boolean b1 = new Boolean(true); | |
boolean b2 = new Boolean(true); | |
System.out.println("b1 == b2 はどうなるの?:" + (b1 == b2)); | |
Boolean bool1 = new Boolean(true); | |
Boolean bool2 = new Boolean(true); | |
System.out.println("bool1 == bool2 はどうなるの?:" + (bool1 == bool2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
実行結果