• Post Reply Bookmark Topic Watch Topic
  • New Topic

path with concat method  RSS feed

 
J Das
Ranch Hand
Posts: 83
Firefox Browser Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all .. is there any alternative way to point to path ?? I have done it by using concat() method.. Please let me know if any..

 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's probably never a good reason to use String.concat(). Just use the + operator, or, if you're in a loop, StringBuilder. Also, you can use the forward slash for a path separator.



However, if the "D:/" + thisuser part is meant to be "the home directory of the user running this program", then you can get that with System.getProperty("user.home").
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!