tag:blogger.com,1999:blog-8712770457197348465.post3662778689781936613..comments2024-03-29T05:54:46.190-07:00Comments on Javarevisited: Difference between Java and C++ Constructor - Interview Questionjavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-8712770457197348465.post-21698331562337912222015-10-11T03:07:24.247-07:002015-10-11T03:07:24.247-07:00@Tapshware, you are getting confused with words, y...@Tapshware, you are getting confused with words, you wrote <b>"Java is not platform independent"</b><br />but I know what you mean. To make it clear, <br /><br />Java is platform independent because it generates bytecode, which is executed by JVM and not the machine itself. <br />C++ is platform dependent because it generates native code which is executed directly by machine. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-24407998311708723342015-10-10T18:49:56.494-07:002015-10-10T18:49:56.494-07:00Java is not platform independent but C++ is Platfo...Java is not platform independent but C++ is Platform dependent..<br />B'coz Java Compiler generates which is Independent...!!!<br />And C++ Directly Generate OBJ Code which is machine Dependent...!!<br /><br />Its my Request to Them Plzz.. correct it..!!<br />Thank you Anonymoushttps://www.blogger.com/profile/14503217785141850875noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-52515988010919356602015-09-09T20:50:37.167-07:002015-09-09T20:50:37.167-07:00Java is much closer to C# than C++, comparing with...Java is much closer to C# than C++, comparing with C++ is old story.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-7440712052497403962015-09-04T20:01:55.139-07:002015-09-04T20:01:55.139-07:00@Christopher, on that context Java developer also ...@Christopher, on that context Java developer also needs to be careful, not to code their application in such way that makes it platform dependent. Simplest example is hard coding path separator, which is different in Linux, Windows and Mac OS X. javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-62025166961857302162015-09-03T20:50:41.746-07:002015-09-03T20:50:41.746-07:00While the same binary cannot be ran on different O...While the same binary cannot be ran on different OSs/architectures, If written well C++ code can be quite portable, only requiring a recompile... But this of course requires forethought on the part of the developer... Java will run without changes anywhere the JVM is implemented.Anonymoushttps://www.blogger.com/profile/15504767395346268328noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-36867973728633535222015-09-03T05:36:34.104-07:002015-09-03T05:36:34.104-07:00@Arul and @Anonymous, You guys are right, C++ is p...@Arul and @Anonymous, You guys are right, C++ is platform dependent, you need to build it separately for windows, Linux or Mac OS X, but you can run same JAR file in all those operating systems.<br /><br />Actually, it was typo, I meant to say that C++ is not platform <b>independent</b>, but Java is :) Some how that "in" get lost.javin paulhttps://www.blogger.com/profile/15028902221295732276noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-13304781695450755132015-09-03T01:02:39.651-07:002015-09-03T01:02:39.651-07:00C++ is not platform dependent but Java is, curious...C++ is not platform dependent but Java is, curious why?<br />Wrong. Right should be: C++ is platform dependent, when Java is not.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-17618164639550664472015-09-02T23:49:30.522-07:002015-09-02T23:49:30.522-07:00C++ is not platform dependent but Java is, curious...C++ is not platform dependent but Java is, curious why? --- Is this statement correct?Arulhttps://www.blogger.com/profile/03572655252976433155noreply@blogger.com