学习日志————java继承多态抽象接口代码(06)

第六天

package day6;

public class Chinese {
  static String country;
  String name;
  int age;
  
}

package day6;

public class Single {
    private Single() {
    	
    }
    private static Single single=new Single();
    public static Single getInstance() {
    	return single;
    }
    	
}

package day6;

public class Tset1 {
    public static void main(String[] args) {
		float f=Float.parseFloat("0.40");
		String fstr=String.valueOf(f);
		int i=Integer.parseInt("555");
		String istr=String.valueOf(i);
		boolean b=Boolean.parseBoolean("true");
		String bstr=String.valueOf(b);
		double d=Double.parseDouble("0.40");
		String dstr=String.valueOf(d);
       
		Chinese.country="zhongguo";
		Chinese c=new Chinese();
		
		Chinese c2=new Chinese();
		System.out.println(c.country);
		System.out.println(c2.country);
    }
}

你可能感兴趣的:(学习日志————java继承多态抽象接口代码(06))