Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert C++ to java??

 
angela brown
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are there any free programs out there that converts C++ code into java?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes and no.
"Yes", there are such programs.
"No", they don't work.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
angela missomething,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
angela brown
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, my name is now changed.
thanks for responding people. i don't supposed anyone would want to convert this to java for me, would they? (I've never been taught c++)

[ October 25, 2003: Message edited by: Dirk Schreckmann ]
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I can give you some hints.
  • "cout << something" is the same as "System.out.print(something)" in Java.
  • List<string> is a template instantiation, something that current versions of Java don't have (but JDK 1.5 will!) It means a List specialized to hold string objects. You could use a plain java.util.LinkedList .
  • "cin >> something" is a little trickier in Java; it means read "something" from standard input -- i.e., System.in in Java.


  • This program makes use of a template class List<>, which you don't show here; it's not a class from the standard library. The string class is, though.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic