码迷,mamicode.com
首页 > 编程语言 > 详细

[Java in NetBeans] Lesson 03. More Variables / Type Casting

时间:2018-10-25 11:14:53      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:bsp   ble   参考   youtube   视频   课程   for   pre   str   

这个课程的参考视频在youtube

    主要学到的知识点有:

  • It is different from python, that "1" only present string "1", and ‘1‘ only presents char ‘1‘.
  • (type) can chang the type , e.g. (int) (totalScore/4.5); will change the result of(totoalScore/4.5) which is a float into integer
  • But if want to change String to int or double, it does not work for previous method. Need Integer.parseInt("3") change "3" as 3, need Double.parseDouble("3.0") change "3.0" into 3.0.
  • x = 2, y = 3;  if we want to get double 2/3, then we can do result = x/ (float) y;

[Java in NetBeans] Lesson 03. More Variables / Type Casting

标签:bsp   ble   参考   youtube   视频   课程   for   pre   str   

原文地址:https://www.cnblogs.com/Johnsonxiong/p/9841030.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!