Returning through multiple functions
<p>Alright, this might be kinda simple, but I cannot figure out how to do this. How can I change this function to return the <code>String class_name</code>? I know that I need to change the function from <code>void</code> to <code>String</code>, but what else do I need to do?</p>

<p>Much appreciated!</p>

<pre><code>public void addClass() {
    AlertDialog.Builder alert = new AlertDialog.Builder(this);  

    alert.setTitle("Add Class");

    final EditText input = new EditText(this);  
    alert.setView(input);  

    alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {  
        public void onClick(DialogInterface dialog, int whichButton) {  
            String class_name = input.getText().toString();
        }  
    });  

    alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {  
        public void onClick(DialogInterface dialog, int whichButton) {  
        }  
    });  

    alert.show();
}
</code></pre>
