• Post Reply Bookmark Topic Watch Topic
  • New Topic

path with concat method  RSS feed

 
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..

 
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").
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!