Biblioteca Java - Blame information for rev 36
Subversion Repositories:
Rev | Author | Line No. | Line |
---|---|---|---|
36 | mihai | 1 | import java.lang.reflect.Method; |
2 | |||
3 | |||
4 | public class Point { | ||
5 | private int x; | ||
6 | private int y; | ||
7 | |||
8 | public int getX() { | ||
9 | return x; | ||
10 | } | ||
11 | |||
12 | public void setX(int x) { | ||
13 | this.x = x; | ||
14 | } | ||
15 | |||
16 | public int getY() { | ||
17 | return y; | ||
18 | } | ||
19 | |||
20 | public void setY(int y) { | ||
21 | this.y = y; | ||
22 | } | ||
23 | |||
24 | public String toString(){ | ||
25 | return "Point["+x+","+y+"]"; | ||
26 | } | ||
27 | |||
28 | public static void main(String[] args) { | ||
29 | Point p = new Point(); | ||
30 | Class co = p.getClass(); | ||
31 | System.out.println("Class name for object "+p+" is +"+co.getSimpleName()); | ||
32 | |||
33 | System.out.println("List of methods for class "+co.getSimpleName()+":"); | ||
34 | Method[] ms = co.getDeclaredMethods(); | ||
35 | for(Method m:ms) | ||
36 | System.out.println(m.getName()); | ||
37 | } | ||
38 | } |