Guest User

Test.java

a guest
Dec 2nd, 2010
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 1.94 KB | None | 0 0
  1.  
  2. public class Test{
  3.  
  4.      private static boolean b_s;
  5.      private static byte bt_s;
  6.      private static short s_s;
  7.      private static int i_s = 555;
  8.      private static long l_s;
  9.      private static float f_s;
  10.      private static double d_s;
  11.      private static char c_s;
  12.      private static Object o_s;
  13.  
  14.      private boolean b;
  15.      private byte bt;
  16.      private short s;
  17.      private int i;
  18.      private long l;
  19.      private float f;
  20.      private double d;
  21.      private char c;
  22.      private Object o;
  23.  
  24.     public void init()
  25.     {
  26.           System.out.println("Starting Test.init()");
  27.           System.out.println("i_s: "+i_s);
  28.           b = true;
  29.           bt = 5;
  30.           s = 6;
  31.           i = 7;
  32.           l = 8L;
  33.           f = 9f;
  34.           d = 10d;
  35.           c = 'z';
  36.           o = new java.util.ArrayList(i);
  37.           System.out.println("b: "+b+", bt: "+bt+", s: "+s+", i: "+i+", l: "+l+", f: "+f+", d: "+d+", c: "+c+", o: "+o);
  38.  
  39.           b_s = true;
  40.           bt_s = 5;
  41.           s_s = 6;
  42.           i_s = 7;
  43.           l_s = 8L;
  44.           f_s = 9f;
  45.           d_s = 10d;
  46.           c_s = 'z';
  47.           o_s = new java.util.ArrayList(i_s);
  48.           System.out.println("b_s: "+b_s+", bt_s: "+bt_s+", s_s: "+s_s+", i_s: "+i_s+", l_s: "+l_s+", f_s: "+f_s+", d_s: "+d_s+", c_s: "+c_s+", o_s: "+o_s);
  49.  
  50.           byte[] bytes = new byte[11];
  51.           bytes[4] = 12;
  52.           System.out.println("bytes[4]: "+bytes[4]);
  53.           System.out.println("bytes.length: "+bytes.length);
  54.  
  55.           String[] fill_data = new String[]{"bob", "tom", "jim", "tim"};
  56.           System.out.println("fill_data: "+fill_data);
  57.           for(String data : fill_data)
  58.                System.out.println("data: "+data);
  59.          
  60.  
  61.           System.out.println("Finishing Test.init()");
  62.     }
  63.  
  64.     public static void main(String[] args)
  65.     {
  66.         new Test().init();
  67.           System.out.println("Finishing Main method");
  68.     }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment