京东物流|学习Java第一天( 二 )



public class Test02 {
    public static void main(String[
args) {
        byte b = 3;
        b = b + 4;//需要强转  b = (byte)(b+4);  b+=4;
        System.out.println(\"b=\" + b);
   


【京东物流|学习Java第一天】
public class Test07 {
    public static void main(String[
args) {
        int x = 2;
        {
            int y = 6;
            System.out.println(\"x is \" + x);
            System.out.println(\"y is \" + y);
       
        y = x; //y取不到值  int y = x;
        System.out.println(\"x is \" + x);
   



推荐阅读