D
Danger_Duck
In paramaters, can I specify what type of String I want? For example,
can I do something like:
public void method1(static final String s) {
//do something
}
I suppose my bigger question is how you specify a fixed value without
resorting to Java's ugly implementation of enumarations.
For instance, I want to have a class that will graph functions based
on type, but one of the parameters is "sin, square, sawtooth" etc.
Right now, I have declarators like 'public static final String sin =
"SinWave"; ' at the top of my class, and would like it so that the
constructor only accepts static final strings. Of course, he might use
such strings from different classes to my dismay, but at least I will
filter it out a bit.
So am I able to get more specific about the parameters I want to take
in? My gut feeling is no since the above code looks atrocious, but I
would like to hear how one goes about such things in a simple manner
(again, without enumerations).
can I do something like:
public void method1(static final String s) {
//do something
}
I suppose my bigger question is how you specify a fixed value without
resorting to Java's ugly implementation of enumarations.
For instance, I want to have a class that will graph functions based
on type, but one of the parameters is "sin, square, sawtooth" etc.
Right now, I have declarators like 'public static final String sin =
"SinWave"; ' at the top of my class, and would like it so that the
constructor only accepts static final strings. Of course, he might use
such strings from different classes to my dismay, but at least I will
filter it out a bit.
So am I able to get more specific about the parameters I want to take
in? My gut feeling is no since the above code looks atrocious, but I
would like to hear how one goes about such things in a simple manner
(again, without enumerations).