猿问
有关java 数据类型的问题
为什么如果打印 int x = 3/2 就可以是1 但是打印int x= 1.0就会报错?
就这样8不知道
浏览 710
回答 1
1回答
慕慕5436299
HABBMSTNGGARLUDIBYXUHUGSYYYZYCMQEKGZVYZGTKXGEXJCGHNTUWWMYULCPAAAHOQQCSCIIBLVLMWYYREPPDRRWCSIFJTJWQNZXJTWQZJGGNIJJNDXDNKKMWJUGNOERERZJPIYPGPNANXGLRHYVEEXYKCVVISEKKBLLGPNNREQGUAOPPVLBWGGAUELROELRHKNBVZFIOPNKAHYXZVSIVCLVBZZIIRJPGNGQHXGFYVIVVOPSXAGWSKULIZJMUTDMQXUEUERNTBAEUEEBBPOKZPXAHSFZBHGTMZHXGUVBDDZZMSQXXHDHUGTDTMMGELBUNXJGSMJKKURAKBRDGCAKQCIIVJWMWQJONWNJOKHLZXVEEUDUEXXPIMFSLPZMMPJWBHDXXGJJGTUBAJJWJCMEIMCSOSOCRZMMJMVBLEDKGDNGKGZZREUKUHJWJVMVFLBSIIOOQXGDPPCYYGOUTHKXXQKXQZFNTHHOVMMQWJTCKGMZWDZBAHYYYEEVVILXHRUQRYMFZYLEBVKHNBYBLKRXKXDKRHKNGWTGIUXEFTUUKXETAQKKEBNDNNGRXTTBKLLZVPZIPMGCOQANKDNNROXDXXUUHXIQFVXTDGHQAQUVLADGWTHRHYAQZCFBKADTVTVYHRBEGKBKDRHEHEBRHSCFCKMVSBXNXHWTBYHXFIYVSIEAQGWSIRDMTPMIMPFVLIDJSHDTQTIFBL
0
0
0
慕用8387691
int是整型类型,1.0是浮动类型,改成 double x= 1.0; 就可以了
0
0
0
随时随地看视频
慕课网APP
相关分类
Java
我要回答