chinni005 Posted March 25, 2013 Author Report Posted March 25, 2013 [quote name='Thingarodu' timestamp='1364236320' post='1303485058'] array anedi object.... nuvvu em mention cheyyakapothe null vuntundi object value... appudu array ni access cheyyadaniki try chesthe "NullPointerException" vasthundi... int[] arr = new int[10]; ippudu arr ani oka integer array create avuthundi with size 10 and indexes from 0 to 9. If you try to access arr[20] you will get "ArrayIndexOutOfBoundsException"... [/quote] ipudu nenu code lo [0] [1] [3] ee three indexes ey handle chesa.. oka vela mana application or user entered data [4] th index lo em ayina insert chesthe dhanni code lo hadle cheyyaledhu anko em avthundhi mama?
chinni005 Posted March 25, 2013 Author Report Posted March 25, 2013 element leni index ni access chesthunnana
chinni005 Posted March 25, 2013 Author Report Posted March 25, 2013 [quote name='biscuitraja' timestamp='1364237464' post='1303485158'] try biscuitraja it will work [/quote]
chinni005 Posted March 25, 2013 Author Report Posted March 25, 2013 null check pedithe saripothundha?
biscuitRAJA000 Posted March 25, 2013 Report Posted March 25, 2013 [quote name='RockStarr' timestamp='1364237491' post='1303485162'] [/quote] cherlapalli jailer ki pm pettu
Thingarodu Posted March 25, 2013 Report Posted March 25, 2013 [quote name='RockStarr' timestamp='1364236448' post='1303485067'] kaani insert cheydaaniki.. String[] obj = new String[2] obj = formBean.getUserName(); String rockstar = obj[0]; String tingarodu = obj[1]; String karna = obj[2]; ila ichadu..! ipudu out of bounds obj[3] lo insert chesthunte osthundhi ankundhaam..! nenemo size 20 ki penchina.. kaani code lo ob[3] lo insert cheymani emi ledhu...! malli exception em ayina osthundha? [/quote] String[] obj = new String[2] - it will create an array of strings with size 2 (so you can access obj[0], obj[1] only) obj = formBean.getUserName() - you are changing the reference of obj from string array (which you created in above step) to the value returned from getUserName() method... so aa method em return chesthe nee obj daaniki point chesthundi...
chinni005 Posted March 25, 2013 Author Report Posted March 25, 2013 [quote name='Thingarodu' timestamp='1364237643' post='1303485182'] String[] obj = new String[2] - it will create an array of strings with size 2 (so you can access obj[0], obj[1] only) obj = formBean.getUserName() - you are changing the reference of obj from string array (which you created in above step) to the value returned from getUserName() method... so aa method em return chesthe nee obj daaniki point chesthundi... [/quote]
chinni005 Posted March 25, 2013 Author Report Posted March 25, 2013 data base lo froblem undhi aa value raakapoye sariki ee array a valu ni access cheydaaniki try chesi bisket avthundhi..
Recommended Posts