Method)
Method




      Class         Class    Method
   Class    Class   public
main Method
method   Java   2   Method
                  Method

1.Method
- Method
- Method
- Method
         parameter
- Method

2. Method
method
         body    method main()       method
                                         method
                           method main()
syntax
1.              static method

2.                static method
Math
int    double




   Math
Math
        math
- sqrt()                         Math.sqrt(

- cbrt()                        Math.cbrt(64)
           4
- pow()                        Math.pow(2,4)
           2      4   16
- abs()                        Math.abs(-4)        4
- ceil()

Math.ceil(3.27)            4    Math.ceil(-3.27)
'   '
(True)    '   ' (False)




         10
local
public class LocalVars {
public static void main String args {
                   texas ;
                   california ;
          } // end of main
public static void texas {
          int birds 500;
          System out println In texas, there are birds birds ;
} // end of texas
public static void california {
          int birds 3500;
          System out println In california, there are birds birds ;
} // end of california
} // end of class
overloaded methods)"
11

25

26

27

28

กลุ่ม 3 method

  • 2.
  • 3.
    Method Class Class Method Class Class public main Method
  • 4.
    method Java 2 Method Method 1.Method - Method - Method - Method parameter - Method 2. Method
  • 5.
    method body method main() method method method main() syntax 1. static method 2. static method
  • 6.
    Math int double Math
  • 7.
    Math math - sqrt() Math.sqrt( - cbrt() Math.cbrt(64) 4 - pow() Math.pow(2,4) 2 4 16 - abs() Math.abs(-4) 4 - ceil() Math.ceil(3.27) 4 Math.ceil(-3.27)
  • 8.
    ' ' (True) ' ' (False) 10
  • 9.
  • 10.
    public class LocalVars{ public static void main String args { texas ; california ; } // end of main public static void texas { int birds 500; System out println In texas, there are birds birds ; } // end of texas public static void california { int birds 3500; System out println In california, there are birds birds ; } // end of california } // end of class
  • 11.
  • 13.