按照毕老师的视频敲同样的代码,不同的结果。- class Person
- {
- String name;
- String country="CN";
- public void show()
- {
- System.out.println(country+":"+name);
- }
- }
- class StaticDemo
- {
- public static void main(String[] args)
- {
- Person p=new Person();
- p.name="xiaoqiang";
- p.show();
- //System.out.println("Hello World!");
- }
- }
复制代码
|
|