Hi, im a total Java beginner and was just hoping someone could help me work out why i'm getting an 'illegal start of expression' error on the first line:
(public boolean isFull()) of this code:

public boolean isFull()
                {
                    for (int a = 0; a < 10; a++)
                    {
                        for (int a2 = 0; a2 < 10; a2++)
                        {
                            if(cacheDataArray[a][a2] == 0)
                            {
                                return false;
                            }
                            else
                            {
                                return true;
                            }
                        }
                    }       
                }        
                
                if (isFull())
                {
                    for (int b = 0; b < 10; b++)
                    {
                        for (int c = 0; c < 10 c++)
                        {
                            if (cacheDataArray[b][c] == lruArray[0])
                            {
                                cacheDataArray[b][c] = testData[j];
                            }
                        }
                    }
                }
                for (int d = 0; d < lruArray.length; d++)
                {
                    lruArray[d] = lruArray[d+1];
                }

Theres more code than that in the program, just didnt want to go overkill on the code. If there aren't any apparent errors in this code Ill put the rest =)

Recommended Answers

All 3 Replies

check before line

public boolean isFull()

..

that is you may missed close brace '}' for any open brace '{'...

Okay ill have a look =)

Cross-post

I'm outta here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.