zoukankan      html  css  js  c++  java
  • java第六天

     p37

    1、java ant详解

    练习8

    /**
     * Created by xkfx on 2017/2/26.
     */
    class A {
        static int i = 47;
    }
    public class TestStatic {
        public static void main(String[] args) {
            A a1 = new A();
            A a2 = new A();
            A a3 = new A();
            a2.i++;
            a3.i++;
            System.out.println(a1.i);   // 并没有直接通过a1来改变i
        }
    }

    练习9

    /**
     * Created by xkfx on 2017/2/26.
     */
    public class Test {
        public static void main(String[] args) {
            Boolean b = true;
            boolean b1 = b;
            System.out.println(b1);
    
            Character ch = 'x';
            char c = ch;
            System.out.println(c);
    
            Byte by = 1;
            byte b2 = by;
            System.out.println(b2);
    
            Integer in = 1;
            int k = in;
            System.out.println(k);
        }
    }

    不用写全部吧。。。

    练习10

    /**
     * Created by xkfx on 2017/2/26.
     */
    public class Test {
        public static void main(String[] args) {
            for (int i = 0; i < args.length; ++i) {
                System.out.println(args[i]);
            }
        }
    }

    测试示例:

    mdzz@LAPTOP-QGECNCGO MINGW64 /d/Projects/untitled/src
    $ java Test 1 2 Hello
    1
    2
    Hello

    练习11

    /**
     * Created by xkfx on 2017/2/26.
     */
    public class ALLTheColorsOfTheRainbow {
        int anIntegerRepresentingColors;
        void changeTheHueofTheColor(int newHue) {
            this.anIntegerRepresentingColors = newHue;
        }
        public static void main(String[] args) {
            ALLTheColorsOfTheRainbow x = new ALLTheColorsOfTheRainbow();
            x.changeTheHueofTheColor(17);
            System.out.println(x.anIntegerRepresentingColors);
        }
    }
  • 相关阅读:
    LeetCode 25 Reverse Nodes in k-Group
    圆桌派:家世背景对人的影响有多大
    BibTex 学习笔记
    R parallel包实现多线程1
    IIS学习笔记
    高效完成R代码
    圆桌派 :我们,朋友一生一起走
    高文欣个人简介
    R语言函数话学习笔记5
    git学习笔记1
  • 原文地址:https://www.cnblogs.com/xkxf/p/6446049.html
Copyright © 2011-2022 走看看