Search:

Type: Posts; User: Baldyr

Search: Search took 0.11 seconds.

  1. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    By the way, I finally got the singleton solution working. Thanks Cornix!

    //singleton class for holding global variables
    class Globals {

    // setup singleton instance
    private static Globals...
  2. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    Well, I really can't see the difference between your singleton class and mine. :-? Except that mine is defining variables inside the constructor, whereas yours only assigns the values once the...
  3. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    That is probably what I've already done as far as the architecture goes, since I've set up a Globals class, a Enums class, a Debug class, a UserInterface class and a Test class. I actually managed...
  4. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    Yeah, I kinda realize this at some level. This style of coding is probably how I would have implemented this in (a language like) Python. I'll give the singleton route a try, as I've been observing...
  5. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    For anyone who might be interested to see the end result
    abstract class Globals {

    //private class variables - default values
    private static int[] attributesPrelim = {0, 0, 0, 0};
    private...
  6. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    I was actually gonna test whether or not totalAttributes would get assigned a default value of zero or not, but thanks for the info. Invaluable advice, all around! ^:)^
  7. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    Thanks!

    So I should create like a main method which initializes the variables, then?
  8. Replies
    16
    Views
    1,520

    [SOLVED] Re: Compile error for enhanded for loop

    I'm not entirely sure how to copy text from Command Prompt, but the arrow points to the letter f in for. Like:

    for( int value : attributesFinal ) {
    ^
  9. Replies
    16
    Views
    1,520

    [SOLVED] Compile error for enhanded for loop

    The second line is resulting in a Illegal start of type error.
    int totalAttributes;
    for( int value : attributesFinal ) {
    totalAttributes =+ value;
    }
    I'm pretty sure that there are no...
Results 1 to 9 of 9