'''
package a1;
public class Test {
private static int a = 1;
public static void main(String[] args) {
int a = 2;
System.out.println(a);
}
}
'''

Java变量遵循同名变量屏蔽原则
'''
public static void main(String args[]) {
System.out.println("0.05 + 0.01 = " + (0.05 + 0.01));
System.out.println("1.0 - 0.42 = " + (1.0 - 0.42));
System.out.println("4.015 * 100 = " + (4.015 * 100));
System.out.println("123.3 / 100 = " + (123.3 / 100));
}
'''

使用double类型的数值进行计算,其结果是不精确的。
'''
public static void main(String[] args)
{
BigDecimal f1 = new BigDecimal("0.05");
BigDecimal f2 = BigDecimal.valueOf(0.01);
BigDecimal f3 = new BigDecimal(0.05);
System.out.println("����ʹ��String��ΪBigDecimal�����������ļ�������");
System.out.println("0.05 + 0.01 = " + f1.add(f2));
System.out.println("0.05 - 0.01 = " + f1.subtract(f2));
System.out.println("0.05 * 0.01 = " + f1.multiply(f2));
System.out.println("0.05 / 0.01 = " + f1.divide(f2));
System.out.println("����ʹ��double��ΪBigDecimal�����������ļ�������");
System.out.println("0.05 + 0.01 = " + f3.add(f2));
System.out.println("0.05 - 0.01 = " + f3.subtract(f2));
System.out.println("0.05 * 0.01 = " + f3.multiply(f2));
System.out.println("0.05 / 0.01 = " + f3.divide(f2));
}
'''

'''
public static void main(String[] args) {
int X= 100;
int Y = 200;
System.out.println("X+Y="+X+Y);
System.out.println(X+Y+"=X+Y");
}
'''
