• Post Reply Bookmark Topic Watch Topic
  • New Topic

help me out!!! i m new 2 java  RSS feed

 
salman khan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i compile dis code it gives me error as String reverse(); ; expected,,. whr is my mistake,,, actually it has to display an exception.. its the goal of this prgm... public class Propagate
{
public static void main(String [] args)
{
String reverse();
}
String reverse(String reversestr,String s)
{
reversestr="";
for(int i=reversestr.length()-1;i>=0;--i)
s=+reversestr.charAt(i);
return s;
}
}
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

First, a bit of business. On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

Also, UseCodeTags when posting code of any length. It makes it much easier to read. you should also UseAMeaningfulSubjectLine.

There are a number of problems with the code, some mere typos, some more serious. I've modified it a bit as follows; try to understand what it does. You can run like "java Propagate reverse-this".

[ March 22, 2008: Message edited by: Ulf Dittmer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!