• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Strings instead of methods  RSS feed

 
Greenhorn
Posts: 3
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.

 
Master Rancher
Posts: 2712
92
  • 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
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!