Results 1 to 4 of 4

Thread: compiling error

  1. #1
    Adeline is offline Member
    Join Date
    Dec 2010
    Posts
    4
    Rep Power
    0

    Default compiling error

    I hope i've started this thread in the correct place.
    my error is Sytax error on token ")", Statement expected this token.i've readen another answer about this, on this forum but for me it's not a good one. so i atach my java code:

    import java.util.Scanner;
    import java.io.*;
    import java.lang.Object;

    public class markov {
    public void veriflambda(String cuvant)
    {
    int lung;
    lung=cuvant.length();
    if(cuvant.indexOf("@")>=0)
    if(lung>1) //this is where i have this problem

    }
    public static void main(String[] args){
    System.out.println("introduceti alfabetul: ");
    Scanner scan=new Scanner(System.in);
    String alfa;
    alfa=scan.next();
    String regdr[],regstg[];
    regdr = new String[100];
    regstg = new String[100];
    String cuvvid="",cuvinit;
    int n;
    System.out.println("Introduceti nr regulilor:");
    n=scan.nextInt();
    System.out.println("Introduceti regulile:");
    for(int i=0;i<n;i++)
    {
    System.out.print((i+1)+".");
    regstg[i]=scan.next();
    System.out.print("->");
    regdr[i]=scan.next();
    System.out.println();
    }
    String cuvvidinit="";
    System.out.println("Cititi cuvantul:");
    cuvinit=scan.next();
    int i=0;
    int poz;
    // the rest of the code is not important to show it here, if i'm wrong tell
    // me and i'll atach all of it
    }
    }

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,348
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Adeline View Post
    Java Code:
    public void veriflambda(String cuvant)
    {
    	int lung;
    	lung=cuvant.length();
    	if(cuvant.indexOf("@")>=0)
    		if(lung>1) //this is where i have this problem
    		
    }
    There is no statement following that last if clause; that's why the compiler is whining at you.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Adeline is offline Member
    Join Date
    Dec 2010
    Posts
    4
    Rep Power
    0

    Default

    i was about to write but i stucked there when i saw that error
    thanks a lot

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

Similar Threads

  1. compiling error
    By Adeline in forum AWT / Swing
    Replies: 3
    Last Post: 12-03-2010, 07:18 PM
  2. Error while compiling
    By vibaviattigala in forum New To Java
    Replies: 3
    Last Post: 11-30-2010, 02:07 PM
  3. dos compiling error msg.
    By gatehrdy in forum New To Java
    Replies: 22
    Last Post: 09-01-2010, 12:06 AM
  4. Having error while compiling
    By Kodeee in forum New To Java
    Replies: 12
    Last Post: 03-17-2009, 11:08 AM
  5. Error while compiling
    By ai_2007 in forum Advanced Java
    Replies: 1
    Last Post: 07-01-2007, 11:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •