Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Software Development
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop driver dvd email error excel excel 2003 firefox hard drive hardware hdmi hijackthis internet itunes keyboard laptop malware monitor network networking outlook problem ram recovery router screen slow sound spyware tdlwsp.dll trojan vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
i have a illegal start expression and i dont know how to fix it

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
funkyfresh's Avatar
Junior Member with 2 posts.
 
Join Date: Nov 2009
02-Nov-2009, 12:20 PM #1
i have a illegal start expression and i dont know how to fix it
publicclass tournament
{
publicstaticvoid main (String[] args) throws java.io.IOException
{
//Getting the name of the files to be compared.
BufferedReader br2 = new BufferedReader (new
InputStreamReader(System.in));
System.out.println("Enter 1st File name:");
String str = br2.readLine();
System.out.println("Enter 2nd File name:");
String str1 = br2.readLine();
String s1="";
String s2="",s3="",s4="";
String y="",z="";
//Reading the contents of the files
BufferedReader br = new BufferedReader (new FileReader (str));
BufferedReader br1 = new BufferedReader (new FileReader (str1));
while((z=br1.readLine())!=null)
s3+=z;
while((y=br.readLine())!=null)
s1+=y;
System.out.println ();
//String tokenizing
int numTokens = 0;
StringTokenizer st = new StringTokenizer (s1);
String[] a = new String[10000];
for(int l=0;l<10000;l++)
{a[l]="";}
int i=0;
while (st.hasMoreTokens())
{
s2 = st.nextToken();
a[i]=s2;
i++;
numTokens++;
}
int numTokens1 = 0;
StringTokenizer st1 = new StringTokenizer (s3);
String[] b = new String[10000];
for(int k=0;k<10000;k++)
{b[k]="";}
int j=0;
while (st1.hasMoreTokens())
{
s4 = st1.nextToken();
b[j]=s4;
j++;
numTokens1++;
}
//comparing the contents of the files and printing the differences, if any.
int x=0;
for(int m=0;m;
{ <----------------------------------HERE (IT SAYS ILLEGAL START OF EXPRESSION)
if(a[m].equals(b[m])){}
else
{
x++;
System.out.println(a[m] + " — " +b[m]);
System.out.println();}
}
System.out.println("No. of differences : " + x);
if(x>0){System.out.println("Files are not equal");}
else{System.out.println("Files are equal. No difference found");}
}
}
Frank4d's Avatar
Distinguished Member with 6,187 posts.
 
Join Date: Sep 2006
Location: So. California
Experience: Since MS-Dos 3.0
02-Nov-2009, 06:58 PM #2
for(int m=0;m;)
JimmySeal's Avatar
Senior Member with 206 posts.
 
Join Date: Sep 2007
Experience: Getting there
04-Nov-2009, 12:24 AM #3
for(int m = 0; m < a.length; m++)
Reply Bookmark and Share

Tags
illegal start expression

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 06:43 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.