Online Training Spring Hibernate Training in Delhi R Programming Training Course Big Data and Hadoop Training Java Training  
 

Simple Java class program

Ads

 
 

Share on Google+Share on Google+

okurut
Simple Java class program
1 Answer(s)      9 years ago
Posted in : Java Beginners
Ads
View Answers

May 27, 2008 at 5:35 PM


Hi

import java.util.*;
import java.util.Iterator;

public class SimpleIterator{

public static void main(String args[]){
System.out.println("Welcome to roseindia.");
ArrayList<String> array = new ArrayList();
array.add("R");
array.add("o");
array.add("s");
array.add("e");
array.add("i");
array.add("n");
array.add("d");
array.add("i");
array.add("a");
Iterator itr = array.iterator();
while(itr.hasNext()) {
Object element = itr.next();
System.out.print(element + " ");

}
ListIterator litr = array.listIterator();
while(litr.hasNext()) {

Object element = litr.next();
litr.set(element + "");

}
System.out.println("Modified contents of al: ");
itr = array.iterator();
while(itr.hasNext()) {

Object element = itr.next();
System.out.print(element + " ");

}
System.out.println();

}
}

--------------------------------------------

Read for more information.

http://www.roseindia.net/java/

Ads









Related Tutorials/Questions & Answers:
Simple Java class program - Java Beginners
Simple Java class program  Hello, Please help me, Write a simple class that iterates through all the arguments passed in on the command line... java.util.Iterator; public class SimpleIterator{ public static void main(String args
Simple Java class program - Java Beginners
Simple Java class program  Hi sir, Please help me Write a simple class that iterates through all the arguments passed in on the command line...; Hi import java.util.*; import java.util.Iterator; public class
Advertisements
Class Average Program
Class Average Program       This is a simple program of Java class. In this tutorial we will learn how to use java program for displaying average value. The java instances
how to get session object in simple java class??
how to get session object in simple java class??  i am fallowing...) GroupDetailsDao.java (it is also a simple java class which have the jdbc logic... work. 1) GroupDetails.jsp 2) GroupPojo.java (simple pojo class which have
Hibernate Simple Program Using Java Application with Eclipse
Hibernate Simple Program Using Java Application with Eclipse  How to write Hibernate Simple Program Using Java Application with Eclipse? I wish to learn Hibernate using very popular Eclipse IDE. Share me the best tutorial link
Help me to write this simple java frame program
Help me to write this simple java frame program   I want to write a Java program for.... To create a frame with 4 text fields;name,street,city and pin;with suitable labels. Also add a button "OK". After enter values
Sub class of a previous java program
java program is this, import java.util.*; class EmployeeSalaries...Sub class of a previous java program  Create a Faculty subclass... to the Employee base class that simply outputs a message ?Cannot change this Employee?s status
simple program
simple program  how to print * like triangle
A Simple program
A Simple program  Hi I have written the following code: class...; }//method }//class class SecondRectangle{ public int area(int l, int b...); return sarea; }//method }//class public class MyShape{ public void
Very simple `Hello world' java program that prints HelloWorld
Hello World Java Simple Java Program for beginners... the HelloWorld.java file. Class is the basic building block of the java program, java codes... to develop robust applications. Writing a simple Hello World program is stepwise
simple class in php
simple class in php  example of simple class in PHP
simple program question
simple program question  how do i get a java program to take an input from the user and have it terminate by a period and not by pressing enter
how to sort the result of this 2 class program in java.....????
how to sort the result of this 2 class program in java.....????  package setget1_method; import java.util.Scanner; public class Main... setget1_method; class LBook { private String title; private String author; private int
simple calculator program in javascript
simple calculator program in javascript  strong textsimple calculator in javascript
Simple JSP program example
Simple JSP program example  Hi, How to make simple jsp program... with the simple JSP example program. Give me simple jsp program example. Thanks   HI, The very simple JSP program is to display the current date on the JSP
for writting java program why we are taking more than one class
for writting java program why we are taking more than one class  for writting java program only one class is enough but why we are taking more than one class
simple webdesign program with coding
simple webdesign program with coding  how to design a webpage using html   Please go through the following link: HTML Tutorials
source code in java for a program using class - Java Beginners
source code in java for a program using class  Dear sir/madam i want source code in java for following program: WAP which creates a class accountthat stores customer name,account number and type of account.From this derive
code for a simple java program which performs basic arithmetic operation addition,subtraction,multiplication,division........
code for a simple java program which performs basic arithmetic operation addition,subtraction,multiplication,division........  code for a simple java program which performs basic arithmetic operation addition,subtraction
Simple java program
Simple java program Hi this is the thing we got to do and i am totally confused on how to write this program it would be a great help i could be helped... marks up the prices of its items by 25%. Write a Java program that declares
Simple JSP program
Simple JSP program  create a simple jsp page in which number is to be entered by user in jsp page and submit button clicked.If number entered is greater then 100,then message box "no is greater" elseif less "no is lesser
how to pass variable from simple java main class(not servlet) to the jsp page?
how to pass variable from simple java main class(not servlet) to the jsp page?  I have a simple Java class in which I invoke a call to a JSP page... from the simple Java class to the JSP page. How can I do that? Here is my
Simple program to combine all html,ajax,java,servlets,jsp,json - Java Beginners
Simple program to combine all html,ajax,java,servlets,jsp,json  Hi, I learned Java,servlets,jsp basics, html, ajax, json and css. I want to do a program which is a combination of all those technology. For that, i planned
Java program to get class name without package
Java program to get class name without package        In this example we are making a simple...:\javaexamples>java GetClassWithoutPackage Full class name =java.lang.String
Writing Simple Java Script Program
Writing Simple Java Script Program   ... of JavaScript and create your first JavaScript program. Creating your first JavaScript Program In the last lesson you learned how to create simple java script
Simple FTP upload in Java
Simple FTP upload in Java  How to write a program for Simple FTP upload in Java? Any code example of Simple FTP upload in Java will be very helpful for me. Thanks
java class
java class  write a java program to display a msg "window closing" when the user attempts to close the window.(a) create a window class (b) create frame within the window class (c) extends window adapter class to display the msg
java class
java class  please send me the answer of the question which i have send according of java class assoon as possible . Write a java program to display.... a. Create a window class. b. Create frame within the window class. c. Extend
java program
java program  java program to implement the reflection of a particular class details like constructor,methods and fields with its modifiers
Java class
Java class  What is the purpose of the Runtime class
simple pgm
simple pgm  a java program which uses super class