1

If this is something that can be stored in a variable what type of variable would this be. I apologize for not knowing how to ask this correctly however I am learning as OJT and am not familiar with all of the terminology yet. Similarly if this has been answered before I was unsure how to find it.

I would like to store this in a variable solely for the sake of readability as this will be one of five inputs.

If this can not be accomplished, I will just enter it in as necessary.

Thanks!

Kenneth V
  • 11
  • 2
  • What do you mean store it as a variable? Do you want the string which points to the file be stored as a variable? – Frontear Nov 26 '18 at 19:31

1 Answers1

1

Desktop.open has a void return type. That is it doesn't return anything. It just launches an application or throws an exception.

You can store the Desktop object in a variable.

Desktop desktop = Desktop.getDesktop();
desktop.open(new File(".\\"));
Tom Hawtin - tackline
  • 145,806
  • 30
  • 211
  • 305
  • So the first part is the instantiation of Desktop and the desktop.open(new File(".\\")) is considered an initialized variable? Didn't realize I could break that up. thanks! – Kenneth V Nov 26 '18 at 20:10