java(通过类名调用类)

 

class Computer{
 double x,y;
 static double max(double a,double b){
  return a>b?a:b;
 }
}
class Example4_6{
 public static void main(String args[]){
  double max=Computer.max(12,45);
  System.out.println(max);
 }
}

转载于:https://www.cnblogs.com/xuhui123/archive/2013/03/21/2974013.html