Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help with exception

 
neha gautam
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, i m gettin a null pointer exception in this, in line 28,43, 56, , but i m not able figure it out please help
code is






thanks to all
 
Swastik Dey
Rancher
Posts: 1625
5
Android Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C:\neha\files

\ is an escape character in java, so in this case you need

C:\\neha\\files

and same for getFilesInDir("C:\\neha"); in DirectoryTest.java

now even if you specify the correct path its possible that no files exist in the specified in the given directory , so you need to put check before continuing the process

 
Maneesh Godbole
Saloon Keeper
Posts: 11185
15
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Neha,
In future, please use code tags.
I have edited your original post to use code tags, and as you can see it makes the code easier to read an understand. It even displays the line numbers !
 
neha gautam
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it!!!
thank a ton
 
neha gautam
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
roger maneesh thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic