Dear friends,
I have a piece of code that looks like this:
JOptionPane.showMessageDialog(null,"List of Tax Payers for year 2006 (Sorted with NRIC):" + printList() );
However, the compile error was this:
'void' type not allowed here
case 1 : JOptionPane.showMessageDialog(null,"List of Tax Payers for year 2006 (Sorted with NRIC):" +printList() );
my intention was to print the results computed inside printList(); found under the driver file but I can't do that.
If I were to use System.out.println("Results are " + printList() ); can work but why can't it work under JOptionPane??
Thanks in advance!