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 6896077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:59:21+00:00 2026-05-27T06:59:21+00:00

Syntax error on token ;, { expected after this token. I got this error

  • 0
Syntax error on token ";", { expected after this token. 

I got this error on the 11th line and 19th line. Is there anyone can tell me what’s the problem with it?

import java.util.*;
class veding_machine{
    State st;
    veding_machine vm;
    private int price;
    private int k;
    private int k1;
    private int t;
    private int s;
    State Ls[]=new State[7]; // 11th line

    Ls[0]=idle;
    Ls[1]=coins_inserted;
    Ls[2]=sugar;
    LS[3]=nsc;
    Ls[4]=nlc;
    Ls[5]=et;
    Ls[6]=st; // 19th line

 public veding_machine(){        k=0;        k1=0;       t=0;        price=0;
            }

    public void setK(int k){
         this.k=k;
    }
  • 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-27T06:59:22+00:00Added an answer on May 27, 2026 at 6:59 am

    The initialization of Ls should be inside the vending_machine constructor and should be creating instances of the classes “idle” and “coins_inserted”, etc…

    Ls[0] = new idle();
    Ls[1] = new coins_inserted();
    Ls[2] = new sugar();
    Ls[3] = new nsc();
    Ls[4] = new nlc();
    Ls[5] = new et();
    Ls[6] = new st();
    

    and these classes need to extend the State class

    class idle extends State {
      // ...
    }
    

    They don’t need a state instance inside them.

        // removed, State st;
        public coins_inserted(){
          // removed, st=new State();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Error: Syntax error on token setDefaultCloseOperation, Identifier expected after this token Current Code: package
I get the errors Syntax error on token marketrate, VariableDeclaratorId expected after this token...
This query gives me syntax error in when-between line. how can i solve them?
Parse error: syntax error, unexpected $end in blah/blah/blah.php line 1 This is the error
This is the error: Parse error: syntax error, unexpected '}' in /home/idghosti/public_html/testground/mma/include/footer.php on line
i'm getting a syntax error on row.createCell line Multiple markers at this line -
Syntax error on Token Void, @ expected run cannot be resolved to a type
I am getting syntax error with the following statement REPLACE INTO users (screenname, token,
There is a mysterious error at the line ee.add(new BasicNameValuePair(uid,demo)); Eclipse says: Multiple markers
How can I indicate syntax errors (e.g. an illegal sequence of tokens) in an

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.