Share on Google+Share on Google+

1 Answer(s)      9 years ago
Posted in : Java Beginners
View Answers

May 1, 2008 at 6:45 PM

Hi friend,

import java.util.*;
import java.util.Stack;

public class StackExample {
public static void main(String[] args){
BufferedReader object = new BufferedReader(new InputStreamReader(;
System.out.println("Enter number");
int num= Integer.parseInt(object.readLine());
int n = num;
int rev=0;
System.out.println("Number: ");
System.out.println(" "+ num);
for (int i=0; i<=num; i++){
int r=num%10;
System.out.println("After reversing the number: "+ " ");
System.out.println(" "+ rev);
if(n == rev){
System.out.print("Number is palindrome!");
System.out.println("Number is not palindrome!");
catch(Exception e){
System.out.println("Out of range!");
System.out.println("Shortened pack");
Stack lifo = new Stack();
for (int i = 1; i <= 12; i++){
lifo.push(new Integer(i));
// Last in first out means reverse order
// Empty, let's lift off!


read for more information,


Related Tutorials/Questions & Answers:
computers - Java Beginners
computers   Describe any 5 methods in any of the library classes of java?  Hi Friend, Please visit the following link: Here you will get lot
How to develope web service with exachanging xml message between computers using SOAP
How to develope web service with exachanging xml message between computers using SOAP  Hi Friends, I want to developed a webservice using soap as a protocol,in this webservice the client sends a set of 15 parameters and program
E Book Witing
Ebook writing eBook Writing As computers are gaining control of the world, the trend of paper books is out and that of eBooks are sweeping
Java UDP
Java UDP       TCP and UDP are transport protocols used for communication between computers. UDP(User Datagram Protocol) is a very simple connectionless protocol. UDP can
EBook Witing
eBook Writing As computers are gaining control of the world, the trend of paper books is out and that of eBooks are sweeping in. Writing and publishing eBooks has become hugely popular amongst writers
Domain Name
The domain name system (DNS) is a series of letters and numbers that are separated by periods and used to name organizations, computers and addresses on the Internet. The domain name is the way that Internet names are located
The Open Source World is a Big Part of PHP
The PHP scripting language is something that can work on many types of computers and can be used alongside HTML. It is also able to work with a variety of different forms of technology. The big reason for this comes from how PHP is an open
Amazon Web Services (AWS)
, magazines, DVDs, videos, electronics, computers, software, apparel &
What is ASCII?
characters in most of the computers that can be displayed on the computer screen... computers. IBM has its own built-in-code called EBCDIC code containing 256
What is Mobile Website
What is Mobile Website Mobile websites are specially designed for viewing mobile contents on Mobile Phones. Earlier websites were seen only on computers... very slower speed. So websites for computers cannot function well on mobile
ASCII values table
ASCII values table          ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII
PHP Is Great for Website Creation
PHP is one of the most commonly used and understood types of website creation scripts in the world. It is being used by all sorts of different computers and is being loaded onto many servers. Here are some reasons why PHP is so great
Java for complete beginners
Java Guide is available at RoseIndia that help beginners to master the language. Because of its usefulness in both software development for computers and application development for mobile phone, Java is in great demand and so
Work Email- Dos and Don?ts
Work Email- Dos and Don’ts       Introduction With the proliferation of computers...; denotes using emails to vent emotions. With the fast pace of computers, it is very
Remote Desktop Setting in Windows 8
In windows 8 operating system you can easily access other computers inside the network by enabling the Remote Desktop Connection in your PC. 1... on the button before it.   5. Mark the 'Allow connections only from computers
EJB, Enterprise java bean, EJB Intoduction- Enterprise Java Beans (EJB) - An Introduction
of the system to be located on separate computers located in different locations... for servicing the clients in other computers. Object-oriented
Flex Mobile Phone Game Development
, iPhone, iPod, smart phones, mobile phones, computers, and on many gazettes
Top 10 Web Development Skills
of mobile devices that surpassed the traditional computers and devices as points
Windows 8 Operating System
Windows 8 is the latest innovation, which has been launched to make easy handling of the Windows operating system. Launched by the Microsoft it is expected to make easier for the use on personal computers and also for home and business
Intranet Application Development, Intranet Application Development Solutions, Intranet Design
Intranet Application Development Intranet Application Development Services India An intranet is a network of private computers linked together and using different web technologies to share the enterprise's
What is E-Commerce Web Design
conducting of business via Internet with the help of computers


Advertisement null