Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
boolean を int や byte に、またはその逆に型キャストできないのはなぜですか。例: 直感的には 1 のように見え(int)trueますが、例外があります。boolean b=Boolean.valueOf("HI"); 代わりに、 Peaceのように文字列をブール値に「タイプキャスト」する場合があります (この用語の真の意味ではありません) 。ファウストス
(int)true
boolean b=Boolean.valueOf("HI");