+ 2
Print the data using cursors in java language.
requirements: author class ----> Authname, Authage, Authcity. Book class ----> bookname, bookID, Authname. Hashset ----> Insert three objects and print the data using cursors
7 Respuestas
+ 4
-----------------
Iterator:
-----------------
import java.util.HashSet;
import java.util.Iterator;
class IterateHashSet{
public static void main(String[] args) {
HashSet<String> hset = new HashSet<String>(); hset.add("Tim");
hset.add("Rick");
hset.add("Harry");
Iterator<String> it = hset.iterator(); while(it.hasNext()){
System.out.println(it.next());
}
} }
-----------------
for-each loop:
-----------------
for (String temp : hset) {
System.out.println(temp);
}
+ 4
you can apply the same method to your requirements.....
A hint is more than enough to start something new!
+ 3
you can use 3 cursors plus for each loop.
1: Enumeration
2: Iterator
3: ListIterator
+ 1
thanks for the code but you didn't fulfilled my requirements anywhere I got the code
0
I need the whole code Mr. nikhil
0
that's good and sounds great
0
Hi