Jump to content

Recommended Posts

Posted

Hi Bhayya nenu if condition lo okka int value !=0 ani compare chesthunanu but adhi null point exce[tion throw chesthunadhi as i am writing in JSP page so direct gaa compare chesthunanu so koncham chepparu how to handle that NPE

 

getabc method is returning int value

 

if(XYS.getabc()!=0)

 

 

  • Replies 38
  • Created
  • Last Reply

Top Posters In This Topic

  • fake_Bezawada

    8

  • MysorePak

    7

  • LungiLingaraju

    5

  • porsche911

    5

Popular Days

Top Posters In This Topic

Posted

XYZ is null , change to if( XYZ != null && XYZ.getbac() != 0) 

 

 

Hi Bhayya nenu if condition lo okka int value !=0 ani compare chesthunanu but adhi null point exce[tion throw chesthunadhi as i am writing in JSP page so direct gaa compare chesthunanu so koncham chepparu how to handle that NPE

 

getabc method is returning int value

 

if(XYS.getabc()!=0)

 

Posted

0 kadu mama null tho check cheyi

u shd be good

Posted

Idi try chey work ayyidi

If(XYS.getabc() != NULL && CYS.getabc() != "")

Posted

Idi try chey work ayyidi

If(XYS.getabc() != NULL && CYS.getabc() != "")

this works

 

inka more precise

 

If(XYS.getabc() != NULL && XYS.getabc()!=0)

Posted

0 kadu mama null tho check cheyi
u shd be good

XYZ null unatundi anduke NPE throwing so go with checking for null on XYZ first as posted above
Posted

this works

inka more precise

If(XYS.getabc() != NULL && XYS.getabc()!=0)

XYZ ee null unte NPE throw chestadi kada ba
Posted

XYZ ee null unte NPE throw chestadi kada ba



Yeah. First e object check cheyyi.

If (XYZ != NULL && XYZ != "")
Int a = XYZ.getabc();


Paidi try chey.
Posted

ela chesthey i am getting this error

The operator != is undefined for the argument type(s) int, null

this works

 

inka more precise

 

If(XYS.getabc() != NULL && XYS.getabc()!=0)

 

Posted

bhayya a method nuchi integer vasthundhi andhuke nenu 0 THO Comparing

0 kadu mama null tho check cheyi

u shd be good

 

Posted

 

ela chesthey i am getting this error

The operator != is undefined for the argument type(s) int, null

 

if(XYS != null && XYS.getabc() != null && XYS.getabc() != 0)

 

idi try cheyi mayya

Posted

if(XYS != null && XYS.getabc() != null && XYS.getabc != 0)

idi try cheyi mayya

+1
Posted

+1



Deniki object null ayite XYZ.getabc() annapudu error vastundi. Idi lekunda rayali
Posted

Deniki object null ayite XYZ.getabc() annapudu error vastundi. Idi lekunda rayali

 

(XYS != null) condition false ayite compiler doesn't even execute the 2nd condition because of the usage of && statement 

×
×
  • Create New...