0

CAN ANYONE EXPLAIN THE OUPUT AND THE ERROR OF/IN THE FOLLOWING PROGRAM

/*
Debug this program

*/

class WomenMen
{
unsigned int i;
String stirng s[];
String name[]={"men","women");
private f(int i)
{
system.out.println(String+" ");
}
void main(String arg[])
{
System.out.println("Press 0 to enter men's name /n press 1 to enter women's name");
Buffreredreader Br=Bufferedreader(new inputStreamReader(system.In);
i=br.readLine();
switch(i)
{
case 0:
string=br.readLine();
while(string.length());
string[i++]=br.readLine();
case 1:
string=br.readLine();
while(string.length());
string[++i]=br.readLine();
}
//
System.out.println("you have entered names of "+name[i=String.length()>=0]+"these are-:");
for(i-=(string[0].length()>0);string.length()>0;i++,f())
}

2
Contributors
1
Reply
2
Views
11 Years
Discussion Span
Last Post by NPH
0

There are many problems:

1. Fix mispelling/case errors.
2. There is no unsigned keyword
3. main must be public static
4. f has no return type
5. readLine() returns String not int
6. I have no idea what you mean by the following line:

System.out.println("you have entered names of "+name[i=String.length()>=0]+"these are-:");

I recommend that you compile it and go error by error. Post the errors that you get here.

:mrgreen: For more help, www.NeedProgrammingHelp.com

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.