Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6220697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:00:08+00:00 2026-05-24T08:00:08+00:00

I wrote a singleton class to keep track of some variables across my application.

  • 0

I wrote a singleton class to keep track of some variables across my application.

I am getting a syntax error that I can’t figure out, I am sure that I am missing something simple but it’s been one of those days. Anyone see something wrong with my code?

The error is 1084: Syntax error: expecting rightparen before resultNumber.

    public static function setResult(int resultNumber, int value): void
    {
        switch(resultNumber)
        {
            case 2: { this.result2 = value; break; }
            case 3: { this.result3 = value; break; }
            case 4: { this.result4 = value; break; }
            case 5: { this.result5 = value; break; }
            case 6: { this.result6 = value; break; }
            case 7: { this.result7 = value; break; }
            case 8: { this.result8 = value; break; }
            case 9: { this.result9 = value; break; }
            case 10: { this.result10 = value; break; }
            case 11: { this.result11 = value; break; }
            case 12: { this.result12 = value; break; }
            case 13: { this.result13 = value; break; }
            case 14: { this.result14 = value; break; }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:00:09+00:00Added an answer on May 24, 2026 at 8:00 am

    This is not Java:

    public static function setResult(resultNumber:int, value:int): void
    {
        switch(resultNumber)
        {
            case 2: { this.result2 = value; break; }
            case 3: { this.result3 = value; break; }
            case 4: { this.result4 = value; break; }
            case 5: { this.result5 = value; break; }
            case 6: { this.result6 = value; break; }
            case 7: { this.result7 = value; break; }
            case 8: { this.result8 = value; break; }
            case 9: { this.result9 = value; break; }
            case 10: { this.result10 = value; break; }
            case 11: { this.result11 = value; break; }
            case 12: { this.result12 = value; break; }
            case 13: { this.result13 = value; break; }
            case 14: { this.result14 = value; break; }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot figure out why I keep getting a null ref on filename when
I created a Singleton class in c#, with a public property that I want
We have a class that holds configuration information for the application. It used to
For my project I wrote a small config class that loads its data from
class ExtHotelApiService extends HotelApiService { static scope = singleton static transactional = true def
The classic of writing a singleton in java is like this: public class SingletonObject
I wrote 2 classes, Agent and Timing . The third class will contain the
I have a script that appends some rows to a table. One of the
I have an application in java that uses two different threads.And for sharing data
I have a legacy class that I quickly want to write a couple of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.