0

I declared two Strings as below and initialise them as blank but in output one vale is blank and other show null.

   String insert_brand_from_table="",insert_model_from_table="";
   System.out.println("brand:  "+insert_brand_from_table);
   System.out.println("model:  "+insert_model_from_table);

But output is :

   brand:  
   model:  null

Now the null value of model showing null pointer exception error when i try to save model as blank into database.

kleopatra
  • 51,061
  • 28
  • 99
  • 211
  • 1
    why the fx tag? It's completely unrelated ... changed to java. Anyway, it's missing details to be answerable and it's a duplicate. Have a look at the referenced QA to get an idea on how to solve it. When still stuck, come back with a [mcve] demonstrating the problem – kleopatra Oct 01 '20 at 10:54
  • Sorry if it is wrong, actually i'm working in javafx and it show java null pointer exception error, that why i taged as javafx – Sukhmanjit Singh Oct 01 '20 at 10:57
  • 1
    Tried it in a console application and it works as expected! Both of them are empty strings, none of them is written as null – Onur Baştürk Oct 01 '20 at 11:00
  • ok query is solved. thanks everyone – Sukhmanjit Singh Oct 01 '20 at 11:38

0 Answers0