File: Methods.java

package info (click to toggle)
jswat 1.7-2
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k
  • size: 5,656 kB
  • ctags: 3,210
  • sloc: java: 24,683; xml: 130; makefile: 59; sh: 21
file content (57 lines) | stat: -rw-r--r-- 1,246 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// JSwat test for finding methods in classes.
// $Author: nfiedler $ $Date: 2002-10-13 00:03:33 -0700 (Sun, 13 Oct 2002) $ $Rev: 604 $

public class Methods {

    public void meth(short s) {
        System.out.println("s = " + s);
    }

    public void meth(Short s) {
        System.out.println("S = " + s);
    }

    public void meth(int i) {
        System.out.println("i = " + i);
    }

    public void meth(Integer i) {
        System.out.println("I = " + i);
    }

    public void meth(long l) {
        System.out.println("l = " + l);
    }

    public void meth(Long l) {
        System.out.println("L = " + l);
    }

    public void print(Object o) {
        System.out.println("o = " + o);
    }

    public void print(String s) {
        System.out.println("s = " + s);
    }

    public static void main(String[] args) {
        Methods me = new Methods();
        me.meth(10);
        me.meth((short) 20);
        me.meth(30L);
        Methods2 me2 = new Methods2();
        me2.meth(40);
        me2.print(null);
        me2.print(new Integer(101));
        me2.print("abc");
    }
}

class Methods2 extends Methods {

    public void meth(int i) {
        super.meth(i);
        System.out.println("j = " + (i + i));
    }
}