• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Using Strings instead of methods  RSS feed

 
Greenhorn
Posts: 19
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure this is fairly obvious but I am sort of new to this and I've tried looking it up but I can't quite get what I'm looking for.

In my code, I want to, for my sake, use Strings for messages and paragraphs instead of using methods for everything - mainly because it will help me distinguish in-game commands from simple strings.
What type of string should I use, and how do I use and call it? I've looked everywhere but when I type it in it gives me some error.

 
Rancher
Posts: 2833
96
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Drew,

welcome to the ranch, and enjoy the stay!

Sounds like you could use a Properties file, where you store pairs of Strings. The first String is used to look up the second String. Have a look at the Oracle tutorial:
Properties
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!