Home Tutorialhelp Comment need help in my code

 
 

Comment

saima
need help in my code,
February 21, 2008 at 6:52 AM

that my code....pleese i need help in my while and do....

import apcslib.*;
import chn.util.*;

public class Palindrome
{
String sentence;
String reverse;

public Palindrome ()
{
sentence ="";
reverse ="";
}
public void start()
{
getInput ();
reverseInput ();
compareSens ();
}
public void getInput()
{
System.out.println("Welcome To PALINDROME");
ConsoleIO console = new ConsoleIO();
System.out.print("Please enter your sentence ");
sentence = console.readLine();
sentence = sentence.toLowerCase();
System.out.println("Your sentence is " + sentence);
}

public void reverseInput ()
{
String temp = sentence.trim();
System.out.println("Your trim sentence is "+ temp);
int senLength=temp.length();
System.out.println("Length of the sentence is "+ senLength);
int n = temp.indexOf(" ");
System.out.println("The first white space is at "+n);
while (senLength>0)
{
temp=temp=temp.substring(0,n);
temp=temp.substring(n+1,temp.length());
System.out.println("The second white space is at " + temp);
reverse=reverse+sentence.charAt(senLength-1);
senLength--;
}
System.out.println("The reverse is " + reverse);
}
public void compareSens ()
{
if (sentence.equals(reverse))
System.out.println("The sentence is a palindrome");
else
System.out.println("The sentence is not a palindrome");
}
}

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

To find palindrome no in a file - Java Beginners
To find palindrome no in a file  hi all i am having a problem...I wanted to write one java program where i have to count the no of palindrome in a file. I tried it with my own but not able to get result.pls help me out   

Java Beginners

palindrome - Java Beginners
palindrome in java code  I need an example of palindrome in Java .../beginners/Palindrome.shtmlHope, it will help you.amardeep....;& (digit2 == digit4)){ System.out.print("Number is palindrome!" 

Java Beginners

complete the code (palindrome) - Java Beginners
complete the code (palindrome)  Write a program that checks if a word is palindrome. A word is said to be palindrome if it reads the same forward...: noon noon is a palindrome. Enter a word: moon moon is not a palindrome 

Java Beginners

code need - Java Beginners
code need  hi i want to code doing for this. If i have enter the text file in my java project. example input is 1,2,3,4,5(it is in input text file...)  Hi Friend, Try the following code. We hope this will help you 

Java Beginners

palindrome - Java Beginners
+ " is not a palindrome"); } } } For more information on Java visit to : http://www.roseindia.net/java/beginners/ Thanks Thanks... is palindrome. A word is said to be palindrome if it reads the same forward 

Java Beginners

Need help with my project
Need help with my project  Uses a while loop to perform the following steps: -Prompt the user to input two integers: firstNum and secondNum where... line in the file in the format yyyy-mm-dd hh:mm:ss.   The given code 

Java Beginners

palindrome - Java Beginners
palindrome  determines whether or not it is a palindrome. if the number is not five... == digit4)){ System.out.print("Number is palindrome!"); } else{ System.out.println("Number is not palindrome!"); } } catch(Exception e   

Java Beginners

need help - Java Beginners
need help  Need help in programming in Java  Simple java program that will show the output within quotes using system.out.println... the following code is this: public class print1{ public static void main(String 

Java Beginners

Need help - Java Beginners
Need help   To Write a Java program that asks the users to enter a m * n matrix of integers, m and n being the number of rows and columns...; Hi Friend, Please try the following code. We hope that this code will help 

Java Beginners

palindrome - Java Beginners
palindrome  Write a program to find whether a given string is a palindrome or not  Hi Friend, Try the following code: import java.util.*; public class CheckPalindrome{ public static void main(String[] args 

Java Beginners

need help. - Java Beginners
program code and get to the output in uppercase letter.amar 

Java Beginners

palindrome - Java Beginners
palindrome  import java.io.*; class Palindrome { System.out.println("Enter a word:"); BufferedReader br=new BufferedReader(new... expected in 4th line of the program... help me out of it    

Java Beginners

doubt in my program code - Java Beginners
doubt in my program code  i have developed a web browser with the help of standard widget toolkit(swt) and java. i creted some buttons such as GO... the name on that button.can u please help me out to solve this problem.if u need 

Java Beginners

java palindrome
java palindrome  sir i need java program to print 1)integer palindrome 2)string palindrome 

Java Beginners

I need help in doing this. - Java Beginners
I need help in doing this.  Student DataBase i will need creating... already written the Date class, so here is my date code.) public class Date..., and the student's GPA.using arrays and objects, need to structure the information 

Java Beginners

Need someone to check and modify my simple code - Java Beginners
Need someone to check and modify my simple code   How to write a class that contains Variables that hold hourly rate of pay, number of hours...); } }   Hi Friend, You can use following code: import 

Java Beginners

Need *Help fixing this - Java Beginners
Need *Help fixing this  I need to make this program prompt user... and maybe add retrieve function //need help with this one badly. Thanks guys for all the help. import java.text.*; import javax.swing.*; import java.awt.event. 

Java Beginners

need java code - Java Beginners
need java code  i want a program for an algorithm in java which is it has some transactions T1=ABCE T2=CDE T3=DE T4=CDEG T5=BG T6... result . For this algorithm i need a program can any help me 

Java Beginners

I need add my java program with a picture.
I need add my java program with a picture.  Good evng Frnds Friends i created 1 jar file in my desktop. I need add this program with 1 picture... creating 1 picture. Later the program adding code with that picture.. Any 1 plz 

Java Beginners

pls i need help with my assignment
pls i need help with my assignment  how to write a code that ask the user for the height of the triangle and prints the triangle using * eg if height is 3 it prints * and also using import java.util.Scanner 

Java Tips and Examples

Java Program to check Palindrome
Java Program to check Palindrome In this section, you will learn about palindrome in java and how to check any number that is palindrome or not. First... : With the help of this program, we are going to check whether the number is palindrome 

Java Beginners

Need Help - Java Beginners
Need Help  Hello Sir, Am a beginner of Java. Also i did course... projects in Java as well as J2EE... Can u help me and guide to do a project.../reference/tutorials/ http://netbeans.org/kb/trails/java-ee.html http 

Java Beginners

palindrome - Java Beginners
palindrome  example of java program if it is a palindrome or not palindrome   Hi friend, Example to check the number is a palindrome...://www.roseindia.net/java/beginners/Palindrome.shtml Thanks Amardeep   

Java Beginners

palindrome
palindrome  program to find the given string is palindrome or not   Hi Friend, Try the following code: import java.util.*; public class...]; } if(st.equalsIgnoreCase(reversedSt)){ System.out.println("String is palindrome 

Java Beginners

need help on writing a program. - Java Beginners
Writing first Java Program  Hi, I need help to write my first Java... roseIndia to get your query solved. check given link to see the solution of your Java problem.http://www.roseindia.net/java/simple-java-program.shtmlThanks 

Java Beginners

PALINDROME
PALINDROME  how to find palindrome of a number WITHOUT using a string ??   Hi Friend, Try the following code: import java.util.... == reversedNumber){ System.out.print("Number is palindrome!"); } else 

Java Beginners

Sales System.. Need Help!! - Java Beginners
Sales System.. Need Help!!  were going to make a sales system in our... help us.. Thank you very much for your reply in my past questions you are a big help.. Thank you so much. Hope you will help me again thanks!! God Bless and more 

Java Beginners

ERROR with my JAVA code - Java Beginners
ERROR with my JAVA code  The error came up in my main method... it wasnt there until i finished my actionListener coding so I dont know how to fix this....it is really stressing me out!! HELP!!! import java.awt.*; import 

Java Beginners

need help with a program - Java Beginners
Java algorithm - need help with a program  Java algorithm - need help with a program 

Java Tips and Examples

Palindrome Number Example in Java
Palindrome Number Example in Java    ... the palindrome number and how to determine any number is palindrome or not. First of all we are going to read about the palindrome number.  This is the number 

Java Beginners

I need your help - Java Beginners
I need your help  For this one I need to create delivery class... of 20100076). (Code to representing the delivery area either 1 for local delivery... arguments for the year, delivery number within the year, delivery distance code 

Java Beginners

need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
on deadlock in distributed transactions , and in that i am using my sql in java i need... such program if u can provide me...plz plz...help i need the idea/code/implementation...need help....how to connect and disconnect multiple databases(databases created 

Java Beginners

need code - Java Beginners
need code   i want to take the html coding. if user give a input html.... (view -> source) . how it is possible in java.  Hi Friend, Here we are sending you a sample code which will be helpful to you. import java.io. 

Java Beginners

Need an example of basic code.
Need an example of basic code.   Im working on an art project that I... simple so I was hoping java would look more impressive. So I just need a visual... appreciate the help. basically I need to see what this would look like: create 

Java Beginners

Need an example of basic code.
Need an example of basic code.   Im working on an art project that I... simple so I was hoping java would look more impressive. So I just need a visual... appreciate the help. basically I need to see what this would look like: create 

Java Beginners

Need an example of basic code.
Need an example of basic code.   Im working on an art project that I... simple so I was hoping java would look more impressive. So I just need a visual... appreciate the help. basically I need to see what this would look like: create 

Java Beginners

need help with a program - Java Beginners
need help with a program   Part I An algorithm describes how... by the user. The output of the program should be the length and width (entered.... First you would need to make up the "test data". For this algorithm, the test data 

Java Beginners

need java code - Java Beginners
need java code  I want java code for connect to bit.ly and our link is converted into shorten link and give me response. as a converted link 

Java Beginners

Need help in java programming
Need help in java programming  Hello. Can someone please help me... 10% Exam 60% Java program that accepts the following details: student... and terminating the application. Regards!   Hi Friend, Try the following code 

Java Beginners

java - need code - Java Beginners
java - need code  i am java developer. i want to remove file from one folder and same file is paste another folder. i need this code. (java)  hi, I am sending you the code which moves the file from one folder 

Java Beginners

clarify my question - Java Beginners
clarify my question  Dear Sirs/Expert, Thanks for writing back... the matching tutors to the parent. I was telling you that my degree... to me. The idea is that I need to find a match for the parent. Is it have 

Java Beginners

Please help me to modify my java code from php code
Modify Java code from PHP Code  i want to covert this php code int java/JSP. if (isset($_POST['orders'])) { $orders = explode('&', $_POST... the exact result as the above PHP code is giving. So please help me to convert 

Java Beginners

Please help me to modify my java code from php code
Please help me to modify my java code from php code  i want to covert this php code int java/JSP . if (isset($_POST['orders'])) { $orders... help me to convert it into Java. if (request.getParameter("orders") != null 

Java Beginners

need help with java program as soon as possible
need help with java program as soon as possible  So my assignment is to write a program that used while loops to perform 6 different things. 1... number.   Hi Friend, Try the following code: import java.util. 

Java Beginners

details of my program - Java Beginners
details of my program  hi 1- allow the customer to order any thing... of Scanner coz i need to read integers numbers or any other kind of data from the customers... and about the last posted code it dis not run too 

Java Beginners

Finding all palindrome prime numbers - Java Beginners
Finding all palindrome prime numbers  How do i write a program to Find all palindrome prime numbers between two integers supplied as input (start and end points are excluded 

Java Beginners

Java, CSS help - Java Beginners
Java, CSS help  I need help about menu and submenu programming? Hi there, I have 6 pages and 6 buttons, i want add submenu to each my main buttons... time. If you see sample my main menu have no link, This is the code: (please see 

JavaScript Questions

need help to remove and optimise the code for creating a page
need help to remove and optimise the code for creating a page   i have the following code but it has some sorts of error whenever i run the page... to retrive the parameters but it is always showing me null values. My Html page 

JSP Interview Questions

need help...................please
need help...................please  I have a problem in my JSP Coding... on this area. Please help me. By the way, I'm using access Database and JSP coding...) { e.printStackTrace(); } %>   3)For the above code, we have created 

Java Beginners

java help - Java Beginners
java help  Code a try statement that catches an IOException and an EOFException. If an IOException occurs, print the message ?An I/O error occurred....? to the console. You don?t need to code anything within the try block 

Java Beginners

Need help in completing a complex program; Thanks a lot for your help
Need help in completing a complex program; Thanks a lot for your help ... to call the batch file into the Java code. Is there any other way to call... content is user inputted and static content is prewritten. 3) We need to search 

Java Beginners

really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i am confused here on what to write can some 1 help out here i dont quite understand how to code it so can some 1 help out. Part II Write, compile and execute 

Java Beginners

Need help in constructing bubble sort
Need help in constructing bubble sort  using a bubble sort, for each...://www.roseindia.net/java/beginners/arrayexamples/bubblesort.shtml http://www.roseindia.net/java/beginners/arrayexamples/BidirectionalBubbleSort.shtml 

Java Beginners

Help me - Java Beginners
Help me  I m using session in my project session is activated and admin_home.jsp page will be display but data r not displayed plz guide what is incorrect my code 

Java Beginners

I need your help - Java Beginners
I need your help  What is the purpose of garbage collection in Java, and when is it used?  Hi check out this url : http://www.artima.com/insidejvm/ed2/gc.html http://java.sun.com/javase/technologies/hotspot 

Java Beginners

palindrome array problem
palindrome array problem  I'm having trouble figuring this assignment out. Can someone please help me? Generate (write the code) and save in an array Palidrome[250][5] all the 5 letter words using {a, b, c} Write the code 

Java Beginners

please do respond to my problem sooooon sir - Java Beginners
on the link in my browser the link is opened in the internet explorer.i need to open the link also in my own browser.Hope you will help me out.And also sir i need...please do respond to my problem sooooon sir  Hello sir, Sir i have 

Java Beginners

JSP Code - Java Beginners
("drpdwnAllRole"); This is giving me only first selected value but my requirement need...?? Please help me as earliest u can....... Thanks in advance..... Regards Vinay Kumar Rai   Hi Friend, Try the following code: 1 

Java Beginners

( Inheritance,need help in Polymorphism, Overriding) - Java Beginners
( Inheritance,need help in Polymorphism, Overriding)  can any one please help me create this application,thank you Advanced Concepts with Classes( Inheritance, Polymorphism, Overriding) Employees in a company are divided 

Java Beginners

need help creating a lift program - Java Beginners
need help creating a lift program  Classes, Methods, Constructors please i need help to create an elevator program Simulating an Elevator write... for any help rendered 

Java Beginners

Java help - Java Beginners
Java help  I didnot get the code ,therefore I am posting my question again.. Thanks in advance ...:) Programming Assignment: A) Consider the outpatient pharamacy at University Hospital. At the entrance of the pharmacy 

Java Beginners

Need help
Need help  Hello... I need some help I have a method which contains 1 string value and i wnat when this method get called den that string value..." shud b replaced by string value"s" so my new arrayname will b the string 

Java Beginners

Need help
Need help  Hello... I need some help I have a method which contains 1 string value and i wnat when this method get called den that string value..." shud b replaced by string value"s" so my new arrayname will b the string 

Java Beginners

JSP Code - Java Beginners
. Please help me to find the solution. Let me know if i m unclear on my requirement...JSP Code  Dear frnds, I have a problem where i need to display...;Hi Friend, Try the following code: function city(){ var cid 

Java Interview Questions

Need help
Need help  Dear sir, I have a problem. How to write JSP coding.... This name list should get from the database. Please help me. By the way, I'm using access database and jsp code. Thank you 

Java Beginners

Need to have a Java Code - Java Beginners
Need to have a Java Code  Dear Friend, Can we run a unix command like "df -tg" in a remote linux system through FTP server using Java Program? Kindly give me the solution for the above query. Thanks & Regards 

Java Beginners

help
help  i need help with this code. write a java code for a method named addSevenToKthElement that takes an integer array, and an integer k as its arguments and returns the kth element plus 7. any help would be greatly 

IDE Questions

Need urgent help with C++ errors!
Need urgent help with C++ errors!  hi, i'm new to C++ programming. this is my code... i'm using Turbo C++. It's showing so many errors!.. I don't know what to do. Please help!! #include<iostream.h> void main 

Java Beginners

PLEASE HELP WITH MY JAVA
PLEASE HELP WITH MY JAVA  Hey my name is Gavin and im a student at school that takes IT. my teacher has gave me a problem and i can't figure it out please help!!!!!!!! it is a for-loop question: Display the first 5 multiples 

Java Beginners

plz help - Java Beginners
.. but i dont know how to aplly that on my 2 programs: the first code: creating and inserting data in it and the second code reads the inserted data to do... Thread in java : First Code : import java.io.PrintWriter; import 

General

The Array Palindrome Number in Java
The Array Palindrome Number in Java       This is a Java simple palindrome number program... provide you the best explanation with the Java source code. Here we are going 

Java Beginners

Netbeans Question need help desperately!!
Netbeans Question need help desperately!!   Ok here is my code- public class RollDie2 { public static void main(String[] args) { Random..., number, frequency[die1][die2] + 1); okay that's the code....I'm trying to get 

Java Beginners

Java Code - Java Beginners
Java Code  Hi all, I need to copy the contents and subfolders in a particular folder to the other folder using java... Can any one help me with the code... Thanks in advance 

Java Beginners

i need help plz .... Quickly
i need help plz .... Quickly   how can i count how many numbers enterd by the user so the output would be like this Total number of Scores = .... this is my code :- import java.util.Scanner; public class SCORES { public 

Java Beginners

need someone to do/help with code
need someone to do/help with code  i need someone to do a code for me. It is a restaurant menu that displays a list of 10 food items. A customer..., along with the number of items sold..please help did a code 500 times cant 

Java Beginners

need code for file browser
need code for file browser  hi, i need to write a code to browse the file in my computer using Jsp or java.. what is the code for file browser?   JSP Code for browsing: 1)page.jsp: <%@ page language="java" %> 

Java Beginners

Some additions for my previous question - Java Beginners
into the overall code. Also I can't quite figure out how to write the code for the GUI. Could anyone please help?" So my other two questions are: 1...Some additions for my previous question  This is the question I 

Java Beginners

Stymied with Java code - Java Beginners
Stymied with Java code  In dire need of help with my Tic Tac Toe project due (past due actually) and would appreciate any help! Thanks in advance... a winner."); } } I am just at a loss at my error and to finish this up 

Java Beginners

help
Java application  public int remainder(int a, int b...); return (answer); } and in my main, int answerRemain... fine and gives the correct answer. my question is why wont it compile and, how 

Java Beginners

Help With My Java Project?
Help With My Java Project?  Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower... to put it all together to make it work. please help import 

Java Beginners

what is the need of... - Java Beginners
what is the need of...   what is the need of " return type like void ?   Hi Friend, In java, method always require a return type.The main method is the client code therefore jvm does not expected any return 

Java Beginners

Please help need quick!!! Thanks
Please help need quick!!! Thanks  hey i keep getting stupid compile... simulation program of sorts here is my code: RentforthBoatRace.java public...(); ^ 6 errors any help would be appreciated guys. Thanks so 

Java Beginners

need of code
need of code  howto convert greyscale image to binary image in java 

Java Beginners

Java Programming Code HELP
Java Programming Code HELP  Hi, sir/madam. I am new here and currently developing a program whereby it can read the Java source file...: String, attribute name = variable name) Below are my source code. Hope 

Java Beginners

code protection - Java Beginners
code protection  dear friend Please help me, This is importent for me I want to protect my java class and jar file from decompiler software, I... to protect my java class and jar file 

Java Beginners

Need simple java code to start and stop the remote windows service.
Need simple java code to start and stop the remote windows service.  Hi, I Need simple java code to start and stop the remote windows service... is running on Server A,I want to close that service i.e notepad.exe from my remote 

Java Beginners

java code - Java Beginners
java code   Dear Sir i need code for the following... friend, I am sending running. I hope that this code will help you...://www.roseindia.net/java/ Thanks.    Hello Please try the following code may 

Java Beginners

Need Help in Java programming
Need Help in Java programming  Hello. Can someone please help me with writing the following program Java program that gives assignment details such as:assignment number,assignment name,due date,submission date,percentage marks 

Java Beginners

need program - Java Beginners
need program  I need a java program to get the multiple student name and mark.display the student information by sorting the marks in ascending or desending order.  Hi Friend, Try the following code: import 

Java Beginners

java code - Java Beginners
java code  i need a program that will arrange the numbers from greatest to least. but i can only enter numbers ranging from 1 to 100,000...; Hi friend, Code to help in solving the problem : import java.io. 

Java Beginners

This is what i need in this Question - Java Beginners
array. so i need your help to know is it correct or wrong Thank you...This is what i need in this Question  You are to choose between two... explaination with out coding In my understanding I choose the non-empty array 

JSP Servlet Questions

Need help on JAVA JSP
Need help on JAVA JSP  Hi, I have never worked on java and I have... using JAVA JSP). e.g. Tool does not adjust with the resolution of the screen(need to know how I can adjust it based on the cureen system's screen resolution 

Development process Questions

need a Sample code - Development process
need a Sample code  i want run the python script in java code by using Runtime class and output should be formed like XML format.please help me. Advanced Thanks, Krishna 

Java Beginners

Java code - Java Beginners
Java code  My Question is... In this there is Textfield..."); } } In this im writing the code only for alphabet A..which is also same for all alphabet..Please help me and solve my problem   Hello 

Java Beginners

Java code - Java Beginners
Java code  I need help in writing code for converting julian date to gregorian date format. Please help me out asap  Hi Friend, Try the following code: import java.util.*; import java.text.DateFormatSymbols 

Java Beginners

Java Question Anyone need some HELP !!
Java Question Anyone need some HELP !!  Create a file that contains... of the two files. Note: For the above code, you need POI api. import... and poi-scratchpad-3.2-FINAL-20081019.jar files into the following path: \Java 

Java Beginners

java program...need help as soon as possible!!! - Java Beginners
java program...need help as soon as possible!!!  Modify the Lexer (15 points): 1. Use a command line argument for the input file for processing tokens ? do not use simple.x 2. Recognize the new tokens > void float 

Java Beginners

please help me to give code - Java Beginners
(); } } } ------------------------------- read for more information, http://www.roseindia.net/java/beginners/read...please help me to give code  Write a program that reads a file named famous.txt and prints out the line with the longest length. In the case 

Java Beginners

plz help me - Java Beginners
plz help me  Thanks deepak continue response..i face some problem i... admin page this is my web.xml file i m declaring in the session tag... give me reponse my persinal given id  Hi ragni, i am sending 

Java Beginners

Help me please!!! - Java Beginners
Help me please!!!  im badly needing the complete code for this project in java!!! can you please help me???!!! it is about 1-dimensional array in java! it goes something like this. . . "GRADES" Student 1: Student 2 

Advertisements Advertisements
 

 

 

DMCA.com