MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / Communicate

Class Communicate

staticchecking/latent/Latent.java:29–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29class Communicate {
30 public static void speak(Object speaker) {
31 try {
32 Class<? extends Object> spkr =
33 speaker.getClass();
34 Method talk =
35 spkr.getMethod("talk", (Class[])null);
36 talk.invoke(speaker, new Object[]{});
37 } catch(NoSuchMethodException e) {
38 System.out.println(
39 speaker + " cannot talk");
40 } catch(IllegalAccessException e) {
41 System.out.println(
42 speaker + " IllegalAccessException");
43 } catch(InvocationTargetException e) {
44 System.out.println(
45 speaker + " InvocationTargetException");
46 }
47 }
48}
49
50public class Latent {
51 public static void main(String[] args) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected