I spent some time on the sun website reading about classes, but I can't seem to find what I'm looking for.
I got a quick introduction to classes when I used Visual Basic 6 for about a week. I'd like to use classes in Java the same way. I'm trying to do something like this:
d=5;
for (b=.25; b<10; b=b+1/4) {
findangle(b); }
System.out.println(angle) // which is shown just below
//then somewhere (this is where I'm lost)
class findangle(b as double) {
angle=arccos(d/(2*b)); }
Do I need to write class "findangle" in a separate .java file in the same folder? How would that class look, would it have a main? Is there way to have it in the same file? (I guess it's like defining a "Math." function, but I'm still not 100% how they work.)
It seems like the one line "angle=....." could just as easily be put into the "for" statement, but I have so many little statements like this the code gets jumbled very quickly. Is there a better way of organizing the program than using classes?
Thanks,
James

