• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Has Java a feature that c++ hasn�t?

 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dynamically extension of a Java program : Use of Class.forName(String) and classloader.loadClass(String) for loading types not mentioned in the source code.
I think the ability to dynamically extend a running program allows java to do things that can not be done with c++ :
The applet runner within a browser can load and link to a type that is not mention in the code of the java applet runner. Is there any application like that written in c++?
An application server can load and run new versions of a java program while executing the older one in another class loader. In this way it updates java programs without having to shut down the server. Is there any application server written in c++?
Is it true?
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read Dr. Bjarne Stroustrup's FAQ
It will be a good reading and learning experience!

Thanks!
Roseanne
Join our Study Group when certified

 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Roseanne thank you for answering.
I read the FAQ, but it didn�t respond to my question.
Maybe you could post a simple yes or not, unless it is a question with no such kind of anwser. You know, I wouldn�t like to have to post this question to a c++ group. Maybe I could receive hostile posts.
By the way I will be rejoinig the SCJP group as soon as I have finised my second reading of Thinking in Java. I had to leave the group some time ago to study more.
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry! No, I was not answering your question. I was just trying to let you see the other side of the opinion. Put something in its own environment.
I wrote some simple reflection in C++ long time ago, which, of course, cannot compete with the Java one. Another important thing to know is that C++ does not have a Class class, that is one of the fundamental difference between SmallTalk/Java and C++. Read Dr. Bjarne Stroustrup's FAQ or the Prototype pattern in GoF's book, they might help too.
Thanks!
Roseanne

[This message has been edited by Roseanne Zhang (edited August 12, 2001).]
 
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you're right, there is no supertype in C++ that every class descends from like Object in Java. There are architectures used in C++ such as CORBA & COM where all classes participating in the architecture descend from some supertype but these are external to C++ itself.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An equivalent of dynamic class loading in the C++ world would be linking/loading DLLs at runtime. But, that's more an OS feature rather than a C++ specific feature.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying you all.
Sajid Raza, I guess the key is whether the names of the libraries to load can be whithin strings in the source code or retrieved fron the net as it happens with the names of Applets, or they must be "hard coded" like "Type variable = new Type();"
I don�t know C++ that is why I am asking.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic