-
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
}
}
-
Quote:
Originally Posted by
Adeline
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
-
i was about to write but i stucked there when i saw that error
thanks a lot
-