FileOutputStream Reflection
<p>I was just wondering if there was some way I could actually rename the method of the FileOutputStream using reflection in Java. I'm in a Java programming class in college, we just went over how reflection works. Our assignment was to make an example and I choose to do use it with the FileOutputStream. I have this code so far: </p>

<pre><code>import java.io.*;

FileOutputStream One;

try {
  One = new FileOutputStream("Example.txt");
} catch (Exception e) {
  System.err.println("Error! - " + e);
}
</code></pre>

<p>So what would I do is rename FileOutputStream to maybe like TickTok, but it would do the same function. However, what I'm really stuck on is how I would go about doing this. Does anyone know how I would do this?</p>

<p>Edit: What I mean is like</p>

<pre><code>One = new FileOutputStream("Example.txt");
</code></pre>

<p>to:</p>

<pre><code>One = new TickTok("Example.txt");
</code></pre>
