Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Simple Java class program
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


okurut
Simple Java class program
1 Answer(s)      6 years and 7 months ago
Posted in : Java Beginners



Advertisement
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/


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
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
simple class in php
simple class in php  example of simple class in PHP
Very simple `Hello world' java program that prints HelloWorld
Hello World Java Simple Java Program for beginners... program, java codes are written in the java classclass HelloWorld... to develop robust applications. Writing a simple Hello World program is stepwise
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
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 calculator program in javascript
simple calculator program in javascript  strong textsimple calculator in javascript
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
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 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
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
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
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 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
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
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
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
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
Simple Java Projects
Simple Java Projects  Hi, I am beginner in Java and trying to find Simple Java Projects to learn the different concepts on Java. Can anyone tell me where to get it? Thanks
Simple ATM Java Code...
Simple ATM Java Code...  You are required to write a Graphical User Interface that simulates an ATM by building on the program you wrote... will be implementing multiple classes. The super class will consist of the name
simple calculator - Java Beginners
simple calculator  how can i create a simple calculator using java codes?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Thanks
Simple java applet
Simple java applet  Create a Java applet to display your address on the screen. Use different colors for background and text   Please visit the following link: Applet Examples
java spring simple application
java spring simple application  hai I have design a simple application in this I always found class not found exception. I am sendig code as follows... com.mazeed; public class StudentComponent { private String sname; public
simple java search engine
simple java search engine  i have already downloaded the project simple java search engine.but i am not able to run it.can anyone help me.i have.... ABSTRACT Title : Simple Search Engine System Specification: The system on which
 

 

 

DMCA.com