public class Demo {
public boolean odd_1(int i)
{
return i % 2 == 1;
}
public static boolean odd_2(int i)
{
return i % 2 == 1;
}
public static void main(String[] args)
{
Demo demo = new Demo();
System.out.println(demo.odd_1(10)); //调用方式1
System.out.println(demo.odd_1(9));
System.out.println(Demo.odd_2(10));//调用方式2
System.out.println(Demo.odd_2(9));
}
}
|