programme

programme

View Answers

April 30, 2009 at 4:11 PM

Hi Friend,

Please visit the following link to get the stack implementation:

http://www.roseindia.net/java/example/java/util/StackImplement.shtml


Use following code to check whether the string is palindrome or not:

import java.util.*;

public class CheckPalindrome{
public static void main(String[] args) {
String str="madam";
Stack s= new Stack();
int i,count=0;
char array[]=str.toCharArray();

for(i=0;i<array.length;i++) {
char arr=array[i];
s.push(arr);
}
for(i=0;i<array.length/2;i++) {
char st=array[i];
Object ob=s.pop( );
if(st==ob) {
count++;
}
}
if(count==array.length/2) {
System.out.println("String is Palindrome");
}
else{
System.out.println("String is not a Palindrome");
}
}
}

Thanks









Related Tutorials/Questions & Answers:
programme
programme  Using an ATM, customer can access their bank accounts in order to credit/debit cash and check their account balances.You have to write c programme to implement a simple ATM for 15 customers. Initially you have to store
java programme
java programme   1.....programme for reading 10 values for 10 variables using scanner class 2....declares all types of primitive data inside main method
Advertisements
java programme
java programme   i have to write a java programe that calculates the average of 10 students in Test 1 ,Test 2 and Test 3....Values of the marks in all the test for a student should be hardcore.Ialso have to tell the maixmum
menu driven programme
menu driven programme   calculate the area of circle, square, rectangle in menu driven programme in java
hotel management programme in c language?
hotel management programme in c language?  hotel management programme in c language
programme - Java Beginners
programme  java programme to implement stack operation?use stack to check whether a given string is polidrome or not  Hi Friend, Please visit the following link to get the stack implementation: http
data and analytics graduate programme
data and analytics graduate programme  Hi, I am beginner in Data Science and machine learning field. I am searching for the tutorials to learn: data and analytics graduate programme Try to provide me good examples
compiling programme IJVM
compiling programme IJVM  I TRY AND COMPILE THE PROGRAMME BELOW BUT HAS ERROR APPEAR ALL THE TIME,,CAN ANYONE CORRECT THE CODE AND WRITE UP THE NEXT METHOD FOR POWER IN THE PROGRAME AS WELL...URGENT // Program to read two single
JAVA programme - Java Interview Questions
JAVA programme  Perpare a class "package_example" following the basic functionality of "string" type in JAVA.Use of dynamic character arrays for such class is encouraged.Following is expected from the programme: a.Use of 3
Placement Programme
Java programme
c programme
How to add a file in GZIP file format in Java programme.
How to add a file in GZIP file format in Java programme.  Hi please help me. How to add a file GZIP File format in Java program. If example or suggest link for reference then it will be good. thanks,   Hi
making consistency of data member in the whole programme without using static keyword
making consistency of data member in the whole programme without using static keyword  In the below programme i use one boolean variable named check... . But the value of check variable is not maintained in the programme . we can
lucky no programme - Java Beginners
Java programme - Java Beginners
JAVA programme - JDBC
Java programme - Date Calendar
please solve the programme
Problem on JAVA Programme
applet images sleeping programme - Applet
java programme - Java Server Faces Questions
java
java  where i write java programme and how do i execute the programme
java - Java Beginners
java  write a programme to count the no. of customers in bank using static variable
program - Java Beginners
Program and Programme Difference  What is the difference between program and programmer
c++
c++  write a programme that calculates the area and circumference of a rectangle
menu
menu  fibonaci & prime no. display in menu driven in java programme
java - Java Beginners
java  write a java programme to draw diagram for function f(x)=x*x
chat - Java Beginners
chat   basic concept of chatting.. how will we connect the online users ? requirements for a chatting programme
plz give me answer plz
plz give me answer plz  writw a programme to find rank from an array using doubledimmensionalarray
hi....
hi....  plzz sent me d code for counting vowels in a string... gui programme
STRING.....
STRING.....  plzz sent me d code for counting vowels in a string... gui programme
java
java  Write a programme in java to take the value of A and B as input and print the value of(A+B)3 and (A+B)2
Struts
Struts  I want to create tiles programme using struts1.3.8 but i got jasper exception help me out
menu drive programm in java
menu drive programm in java  calculate area of circle, square,rectangele in menu driven programme in java
menu drive programm in java
menu drive programm in java  calculate area of circle, square,rectangele in menu driven programme in java
menu driven
menu driven  display the 1-30 prime no. and fibonacie series in menu driven programme
hi....
hi....  a programme which displays a combobox which contains num from 1 to 10 and calculates the factorial of dt num which user clicks
C++
C++  I have been asked to write a programme that gets five values,gets the sum,average and product please help me
window in center
window in center  if i run the programme thw window is in lie in top left corner i want a window open in center
method
method   how and where, we can define methods ? can u explain me with full programme and using comments
Strongly Typed Programming Languages
Java GUI - Java Beginners
Java GUI  How to use JTray in java programme?  Hi friend, JTrayIcon jtc= new JTrayIcon(image); // jPopupMenu is a javax.swing.JPopupMenu jtc.setRightClickTarget(jPopupMenu); jtc.show(); Thanks
java - Java Beginners
java  write a programme to to implement queues using list interface  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/util/QueueImplement.shtml Thanks
developing skills in java , j2ee - Java Beginners
developing skills in java , j2ee   How to understand or to feel the flow of java or j2ee programme what is the way to become a expert programmer can you please give me tips thanking you
JAVA - Java Beginners
JAVA  WRITE A PROGRAMME FOR SIMPLE CALCULATOR  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Thanks
java - Java Beginners
java  Hii Can any ome help me to Write a programme to merge pdf iles using itext api.  Hi friend, For solving the problem visit to : http://www.roseindia.net/java/itext/ Thanks
thread.interrupted()
thread.interrupted()  show me a example to write thread.interrupted() method in a java programme?   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 Thread Interrupted Method Thanks
thread.interrupt()
thread.interrupt()  show me a example for thread.interrupt() method in a java programme?   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 Thread Interrupt Method Thanks
Hp scanner - Java Beginners
Hp scanner  Hi guys, i would like to access hp scanner using java programme. could you refer me some useful information to proceed

Ads