public static void main(String argv[]) { director_basic_MyFoo a = new director_basic_MyFoo(); if (!a.ping().equals("director_basic_MyFoo::ping()")) { throw new RuntimeException("a.ping()"); } if (!a.pong().equals("Foo::pong();director_basic_MyFoo::ping()")) { throw new RuntimeException("a.pong()"); } Foo b = new Foo(); if (!b.ping().equals("Foo::ping()")) { throw new RuntimeException("b.ping()"); } if (!b.pong().equals("Foo::pong();Foo::ping()")) { throw new RuntimeException("b.pong()"); } A1 a1 = new A1(1, false); a1.delete(); }
public static void main(String[] args) throws IOException { InputStreamReader inputStreamReader = new InputStreamReader(System.in); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); String rLine = bufferedReader.readLine(); // String rLine ="54 56 789"; bufferedReader.close(); String maxString = ""; String minString = ""; String[] val = rLine.split(" "); maxString = A1.maxString(val); minString = A1.minString(val); System.out.println("The longest is " + maxString + "."); System.out.println("Its length: " + maxString.length() + "."); System.out.println("The shortest is " + minString + "."); System.out.println("Its length: " + minString.length() + "."); // int[] v = new int[val.length]; // for (int i = 0; i < val.length; i++) { // // // v[i] = Integer.parseInt(val[i]); // System.out.println(v[i]); // } }
public void test() { B1 b = new B1(); b.min(new String[] {"1"}); // 这里是调用的, B1中的min(String[])方法 A1<String> a = new B1(); String c = a.min(new String[] {"1"}); // 这里是调用的, A1中的min(Object[])方法, 并将其向下类型转换 System.out.println(c); B1 d = new C1(); d.max(); }
public static void main(String args[]) { A1 obA = new A1(); B1 obB = new B1(); // ustawiamy wartosci obA.setA(10, 20); obB.setB(1, 2, 3); obB.setA(-1, -2); // wypisujemy zawartosc System.out.println("Zawartosc A: " + obA.zawartoscA()); System.out.println("Zawartosc B: " + obB.zawartoscB() + "\n"); // wypisujemy sumy System.out.println("Suma A: " + obA.sumaA()); System.out.println("Suma B: " + obB.sumaB()); System.out.println("Suma B: " + obB.sumaA() + "\n"); }