1 class Father
 2 {
 3     
 4     public static String getName()
 5     {
 6         return "father";
 7     }
 8 }
 9 
10 class Children extends Father
11 { 
12     public static String getName()
13     {
14         return "children";
15     }
16 }
17 public class staticTest {
18     public static void main(String[] args) {
19         // TODO Auto-generated method stub
20         Father father=new Father();
21         Father children=new Children();
22         System.out.println(father.getName());
23         System.out.println(children.getName());
24     }
25 
26 }
View Code

相关文章:

  • 2021-11-21
  • 2021-08-08
  • 2022-12-23
  • 2021-11-19
  • 2021-04-05
猜你喜欢
  • 2021-10-10
  • 2022-12-23
  • 2021-07-18
  • 2022-02-22
  • 2022-12-23
  • 2021-05-18
相关资源
相似解决方案