"<identifier> expected" error
807599Dec 18 2006 — edited Dec 18 2006Hi, can anyone please help me to print "String bb" outside the method. I am getting "<identifier> expected" error. My code is
public class Main extends javax.swing.JFrame
{
/** Creates new form Main */
static String bb="";
public Main() {
initComponents();
}
[... lines of code ...]
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt)
{
String b=null;
String bb=null;
Object a=jComboBox1.getSelectedItem();
b=(String)a;
bb=b.substring(0,1);
System.out.println("bb"+bb);//able to print here
}
System.out.println("bb"+bb);//I need to print "bb" here, but the error thrown is "<identifier> expected"