1 19 20 package org.netbeans.api.debugger.jpda.testapps; 21 22 27 public class MethodBreakpointApp { 28 29 public static void main(String [] args) { 30 MethodBreakpointApp sa = new MethodBreakpointApp(); 31 sa.a(); 32 sa.b(); 33 sa.c(); 34 new InnerStatic().getW(); 35 new ConcreteInner().compute(); new ConcreteInner().getString(); 36 } 37 static { 38 System.currentTimeMillis(); 39 } 40 41 public MethodBreakpointApp() { 42 System.currentTimeMillis(); 43 } 44 45 private void a() { 46 b(); 47 c(); 48 } 49 50 private void b() { 51 c(); 52 } 53 54 private void c() { 55 Inner i = new Inner(); i.getW(); i.getW(); 56 } 57 58 private static class InnerStatic { 59 60 private static int q = 0; 61 62 static { 63 q ++; 64 } 65 66 private int w = 1; 67 68 { 69 w ++; 70 } 71 72 public InnerStatic() { 73 w ++; 74 } 75 76 public static int getQ() { 77 return q; 78 } 79 80 public int getW() { 81 return w; 82 } 83 } 84 85 private class Inner { 86 87 private int w = 1; 88 89 { 90 w ++; 91 } 92 93 public Inner() { 94 w ++; 95 } 96 97 public int getW() { 98 return w; 99 } 100 } 101 102 private static abstract class AbstractInner { 103 104 public abstract double compute(); 105 106 } 107 108 private static interface InterfaceInner { 109 110 String getString(); 111 112 } 113 114 private static class ConcreteInner extends AbstractInner implements InterfaceInner { 115 116 public double compute() { 117 double num = Math.PI/2; 118 return Math.round(Math.sin(num)*1000)/1000.0; 119 } 120 121 public String getString() { 122 char[] chars = new char[] { 'H', 'e', 'l', 'l', 'o' }; 123 return new String (chars); 124 } 125 126 } 127 128 } 129 | Popular Tags |