Is it possible to create an instance by using a scanner?
<p>We know how to create an instance by writing in the main...</p>

<pre><code>Class newObject = new Class();
</code></pre>

<p>Is there a way to create a 'newObject' by user's input something and pops a new newObject? I was thinking using the Scanner but i am not sure how it could be done. I was guessing like this:</p>

<pre><code>Scanner sc = new Scanner(System.in);
Class sc.next(); = new Class();
</code></pre>

<p>or like this?</p>

<pre><code>Scanner sc = new Scanner(System.in);
(some name) = sc.next();
Class (some name) = new Class();
</code></pre>

<p>So the user inputs an object name (some name) into the scanner and that object name (some name) will be created.</p>

<p>Thank you very much in advance!</p>
