黑马java基础篇 day02

Today's knowledge is quite similar with c/c++,so I can absorb and master easily.

1.

Like c,the form is --- datatype name value;

2.

Debug is also called as breakpoint debug,we can set one line or more as breakpoint and go through the code step by step.(totally the same as c)

3.

Its form is as below

import java.util.Scanner;(this is at the very top of our code,upper than the definition of class)

and

Scanner sc = new Scanner(System.in);(this is in the main method and before using it)

After the two steps,u can use it as a flexible tool to get information from our keyboard.

If we want to scan an int-type data,we can do like below

int t = sc.nextInt();

Other types like double,char,boolean also obey the rule.(Attention the first latter is upper)

4.

Totally same as c,so I don't go into details.

5.

This is definitely an important point.

When it doesn't come up with a String-type data,the datas would make the calculations,(when coming with char-type,the char will be converted into a int and do the calculation.Remember,these only happen when no String-type occur before),when it comes with a String,the calculations did before won't be impacted,but later any other items would directly linked to the end of the String.

6.

Totally same as c,so I don't go into details.

7.

First,when a data with smaller value-range can be directly passed to a data with larger value-range.

Second,the value-range order is as below

byte -> short -> int -> long -> float -> double(up-going order)

Notice,though long is 8-byte and float is 4-byte,the value-range of long is smaller than float.

Third,when calculating with byte,short or char,they will be converted into int first,and then do the calculation.So codes in the pic make no sense.

8.

Sorry,tonight I paid much time in CS:GO(this game contains a lot of fun when playing with friends,every moment we move as a team and make decision one and another),so this part I didn't finish,tomorrow I will complete this part.

GOOD NIGHT~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值