Reference to fnc
<p>Is there a way in java to do something like this:</p>

<p>void fnc(void Reference_to_other_func());</p>

<p>What I'm trying is basically I have number of places where I need to display this same text to the user and the only difference is which method is invoked after this text. So for example instead of writing:</p>

<pre><code>System.out.println("Hello");
f1();
//in some other place
System.out.println("Hello");
f2();
//etc
</code></pre>

<p>I would like to define one function:</p>

<pre><code>public void f(void Reference_to_other_func())
{
System.out.println("Hello");
Reference_to_other_func();//HERE I'M INVOKING 
}
</code></pre>

<p>and then instead of repeating this whole code I could write something like this:</p>

<pre><code>f(f1);
//in some other place
f(f2)
//etc.
</code></pre>

<p>Thanks for answers</p>
