Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners changing final Boolean value in SwingUtilities.invokeLater()
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


raja
changing final Boolean value in SwingUtilities.invokeLater()
0 Answer(s)      2 years and 7 months ago
Posted in : Java Beginners


Hi,

I have a problem with setting final Boolean value in second time. But it is necessary to me. Have You any Idea of this Scenario?

Here is my code:

public static boolean doCommit()
{
  final boolean success = true;
  SwingUtilities.invokeLater(new Runnable()
  { 
    @Override
    public void run() 
    {                   
       success = "Hi".equals("Hai"); //for example, here, i am trying to calling my method and it says "The final local variable success cannot be assigned, since it is defined in an enclosing type"
    }               
  }); 
  return success;
}

Thanks,

Sekhar


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Advertisements
 

 

 

DMCA.com