File: vartest.java

package info (click to toggle)
jswat2 2.37-1
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k
  • size: 7,092 kB
  • ctags: 5,592
  • sloc: java: 43,576; xml: 1,086; sh: 66; makefile: 57
file content (25 lines) | stat: -rw-r--r-- 718 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
// Test class for variable handling in JSwat
// $Id: vartest.java 1016 2003-11-07 19:56:25Z nfiedler $

public class vartest {

    private static void byteArray() {
        String str = "Hello world bytes!";
        byte[] bytes = str.getBytes();
        System.out.println("str = " + str);
        System.out.println("bytes = " + bytes);
    }

    private static void charArray() {
        String str = "Hello world chars!";
        char[] chars = new char[str.length()];
        str.getChars(0, chars.length, chars, 0);
        System.out.println("str = " + str);
        System.out.println("chars = " + chars);
    }

    public static void main(String[] args) {
        byteArray();
        charArray();
    }
}