static int score1=86;
static int score2=97;
public static void sum(){
System.out.println("总分是: "+(score1+score2));
}
public static void main(String[] args) {
Test.sum();
static int score2=97;
public static void sum(){
System.out.println("总分是: "+(score1+score2));
}
public static void main(String[] args) {
Test.sum();
2017-05-19
final int final_test;
{
final_test =10; //we can initialize the final variable here as well.
}
classname(){
final_test = 20; //also here.
}
{
final_test =10; //we can initialize the final variable here as well.
}
classname(){
final_test = 20; //also here.
}
2017-05-18
package com.imooc.Test;
public abstract class Shape {
public abstract void Perimeter();
public abstract void area();
}
public abstract class Shape {
public abstract void Perimeter();
public abstract void area();
}
2017-05-18
1.static int;
2.static block;
3.test t = new test();
4.instance variable;
5.block;
6.construture function test();
7.test tt = new test(88);
8.instance variable again;
9.block again
10.construture function test(int aa);
...从上面的执行顺序能够理解class variable,instance variable,class block,instance block order
2.static block;
3.test t = new test();
4.instance variable;
5.block;
6.construture function test();
7.test tt = new test(88);
8.instance variable again;
9.block again
10.construture function test(int aa);
...从上面的执行顺序能够理解class variable,instance variable,class block,instance block order
2017-05-18
package com.imooc.duotai;
public class Initail {
public static void main(String[] args) {
Traffic o=new Traffic();
Traffic p=new Airport();
Traffic q=new Bus();
Traffic r =new Ship();
o.transport(0);
p.transport(200);
q.transport(40);
r.transport(400);
}
}
public class Initail {
public static void main(String[] args) {
Traffic o=new Traffic();
Traffic p=new Airport();
Traffic q=new Bus();
Traffic r =new Ship();
o.transport(0);
p.transport(200);
q.transport(40);
r.transport(400);
}
}
2017-05-16