|
I found few mistakes. I've commented them and your program is working fine..
import java.util.Scanner;
public class firstsubroutine {
public static void main (String[] args){
Scanner in = new Scanner(System.in);
System.out.println("Enter the palindrome : ");
System.out.println("? ");
String line = in.next();
line = line.toLowerCase();
if (isString(line) == true){
String reversed = reverse(line);
if (line.equals(reversed)){
System.out.println ("Stripped : " + line);
System.out.println ("Reversed : " + reversed);
System.out.println ("This IS a palindrome.");
}
else{
System.out.println ("Stripped : " + line);
System.out.println ("Reversed : " + reversed);
System.out.println ("This is NOT a palindrome.");
}
}
}
static boolean isString (String isStr){
int i;
for (i = 0; i < isStr.length(); i++){
char ch = isStr.charAt(i);
if (!Character.isLetter(ch))
{
return false;
}
}
return true;
}
static String reverse(String reStr){
int i;
String reverse = "";
for (i = reStr.length() - 1; i >= 0; i--){
reverse = reverse + reStr.charAt(i);
}
return reverse;
}
}
Shivam Kalra
|
|
|
|
|
Shivam Kalra,
Many and many thanks for you support. I tested and worked very well.
Visoth
|
|
|
|
|
No problem bro.
I'm a CS student too. And homework sucks.
|
|
|
|
|
Oh, my friend!!!! I wish I could help you. What language do you use for your homework?
Visoth
|
|
|
|
|
We are using combination of C++ and JAVA.
|
|
|
|
|
I know nothing about C++ but Java is learning.
Anyways, where are you from? I'm Visoth, from Cambodia. Nice to know you here.
I really doubt if you can give me your email address or IM.
Visoth
|
|
|
|
|
|
see - it works... shows code - gets comments - resolved!!
@ Visoth
welcome. Well asked, I appreciate that. Feel free to ask more!
regards
Torsten
I never finish anyth...
|
|
|
|
|
Well, thanks. Are you a programmer?
Visoth
|
|
|
|
|
No - I'm a developer.
To my point of view there is a certain difference between programming and developing.
Programming is just a code based implementation of what is wanted. To me, there has been something planed by another person and one is just responsible for the code.
Developing means to make the whole thing by myself. I'm writing the system architecture (for my parts, some are discuss in the team), the documentation and all other stuff that's needed throughout the development process.
regards
Torsten
I never finish anyth...
|
|
|
|
|
Hi,
From this site[^], where is the JRE in the Notes installation folder? I've installed Lotus Notes 8.5
|
|
|
|
|
It means the folder where the JRE is installed, below the folder where you installed Lotus Notes. A quick view with Windows Explorer will find it for you.
I must get a clever new signature for 2011.
|
|
|
|
|
Under my "C:\Program Files\IBM\Lotus\Notes", there are folders
1.Data
2.framework
3.icc
4.jvm
5.license
6.MUI
7.ndext
8.properties
9.xmlschemas
10.xsp
Tried windows search, but there's no folder name with "JRE" under my Notes installation folder.
|
|
|
|
|
I guess it may be in the jvm subdirectory, you will need to check the content to see if it exists there. Alternatively go back to the site where you downloaded this and ask there.
I must get a clever new signature for 2011.
|
|
|
|
|
I have a Java application which was running on the console, but now this application will be called by a Utility. Is there any way by which the my application returns some value which the utility can understand ?
For eg if its 1: then successful
2:Failed
3:File Not found.
|
|
|
|
|
There is a difference between whether it could and whether it does.
The normal exit value that would indicate success from an application would be zero.
And value except that depends on the application.
An application can fail totally and still return zero unless it is specifically programmed to do differently.
If and only if the application uses the System.exit() method then it can return other values.
Other than that command line tools often use stdio and sometimes stderr. The contents of that would need to be interpreted by any containing application.
|
|
|
|
|
Thanks a lot for your answer.
Can you give me some details on stdio and stderr,like how are they used
|
|
|
|
|
|
hi
where i can find one telnet client source code for interactive with any telnet server ?
thanks
|
|
|
|
|
navidnmc wrote: where i can find one telnet client source code for interactive with any telnet server ?
All over the internet; a quick Google will yield many samples.
I must get a clever new signature for 2011.
|
|
|
|
|
On Google. I did a search for "telnet client source code" and got over 8 million hits. At least one of them must be relevant.
|
|
|
|
|
is Google down again?
Try "Java Telnet" for your search and you will find something like this:
JAVA SSH[^]
regards
Torsten
I never finish anyth...
|
|
|
|
|
|
You can find many article like this[^] one you can also go there[^]
|
|
|
|
|
I am having some issues the the implementation of the JScrollPane in my gui. I was wondering if anybody had any ideas?
For my GUI i the following
JFrame
>JPanel (nav bar)
>JPanel (gridlayout dynamic based on house size)
>> JPanel(each grid/cell)
>>> Componts (label etc)
>> JPanel (Stat bar)
This works fine to select and work with my rooms(part of the project) in each grid. I have the listener attached to the gridlayout panel, so i know where my mouse has clicked and therefore which grid it belongs to. The listener is the mouselistener on the JPanel.
But when i place a JScrollPane in here;
JFrame
>JPanel (nav bar)
>JPanel (gridlayout dynamic based on house size)
>>jScrollPane
>>>JPanel(each grid/cell)
>>>>Components (label etc)
>>>JPanel (Stat bar)
To give me the scroll bars for each room, my gui no longer accepts the mouse event (it does but not on the gridlayout JPanel as it did before). Does anybody know how i can overide the JScrollPane and let my JPanel underneath receive the event?
I am struggle to find a way to do this that will adhere to the MVC structure. As the code to check and prepare everything is in the controller which just hands the basic info over to the view to repaint it all.
Or i am just completely going in the wrong direction
|
|
|
|