Hi,
"Angela K" <crxgurl@shaw.ca> wrote in message
news:Y6Amb.178112$pl3.106284@pd7tw3no...[color=blue]
> I need to translate this code into java, can anyone do it?
>[/color]
No!
Java (like C#) is just another C++ clone without the good stuff.
Never understand why they didn't just use C++ to create applets.
However with a lot more typing every C++ program can be turned into a java
program.
Use java containers instead of C++ templates, have a look at the
documentation at
http://www.javasoft.com
This newsgroup is about the C++ language maybe you should ask this question
in a java oriented group.
Regards, Ron AF Greve.
[color=blue]
> #include <iostream.h>
> #include "LinkedList.h"
> #include "mystring.h"
>
>
> template <class Object>
>
> void printList(const List<Object> & theList) {
>
> if(theList.isEmpty())
>
> cout << "The List is Empty, Dude!!" << endl;
>
> else {
>
> ListItr<Object> itr = theList.first();
>
> for( ; !itr.isPastEnd(); itr.advance())
>
> cout << itr.retrieve() << " ";
>
> } //printing list in else statement
>
> cout << endl;
>
> } // print list
>
> int main() {
>
> string x;
>
> List<string> myList;
>
> ListItr<string> theItr = myList.zeroth();
>
> int i = 0;
>
> printList(myList);
>
>
> cout << "Enter string values, seperated by whitespace." << endl;
>
> cout << "ctrl-d by itself on a line will terminate the process." <<[/color]
endl;[color=blue]
>
> cout << "Watch the List Building Up in Progress!!" << endl;
>
> while (cin >> x) {
>
> myList.insert(x, theItr);
>
> printList(myList);
>
> theItr.advance();
>
> i++;
>
> }
>
> cout << endl;
>
> cout << "Traverse the Entire List.Remove the names(nodes) that begin[/color]
with[color=blue]
>
> the character" << endl;
>
> cout << "\"a\"" << endl;
>
> cout << "Watch the List Shrinkage in Progress!!" << endl;
>
> cout << endl;
>
>
>
> string y;
>
> string a = "a";
>
>
>
> ListItr<string> tItr = myList.first();
>
> for( ; !tItr.isPastEnd(); tItr.advance()) {
>
> y = tItr.retrieve();
>
> if(y[0] == a[0]) {
>
> myList.remove(y);
>
> printList(myList);
>
> }
>
> }
> return 0;
>
> } //main
>
>
>
>
>[/color]