![]() |
how to tell C++ from Java source code?
All right, I admit I'm not a programmer (I took a couple of courses and have done a smattering in Fortran and Databus, but...I'm not a programmer). However, I need to know - if someone showed me their source code, how would I recognize whether I'm looking at C++ or Java? Without asking them, of course. Why? Because I've been tasked with figuring this out as part of a technical interview for a job. I appreciate your help. - Bill
|
Re: how to tell C++ from Java source code?
if this is an interview for a job sureley it is no good asking someone to tell you. If you can't do it and it is needed for the job then if you get the job then what will you do?
Edit: Why don't you look at some examples of C++ programs and Java Programs and see where they differ, that would be the best idea. Chris |
Re: how to tell C++ from Java source code?
I recommend just looking up tutorials of the two different languages and becoming familiar with the differences in syntax
of course the most obvious thing would be if you have the source files then you can tell by the file extensions... |
Re: how to tell C++ from Java source code?
Quote:
// <program-name>.java Do all Java programs begin this way? Do C++ programs begin differently? |
Re: how to tell C++ from Java source code?
Quote:
|
Re: how to tell C++ from Java source code?
Quote:
|
Re: how to tell C++ from Java source code?
file extension for C++ files is usually .cpp
although like titanium decoy says, if all you have to know is what different file extensions mean then how good could that job really be? as for your other question, yes there is something in the code that will tell you which it is, but you have to do what Freaky Chris said. You need to actually take the time to look at different code examples and learn to recognize the syntax. |
Re: how to tell C++ from Java source code?
Before I go any further, I must say that if this is a skill you must possess to perform your work task, it's not wise to simply ask a forum how to tell the difference. That would be the equivalent of a cheat sheet. Does good on the test, but then it has no practicality in the real world.
That being said, I'd suggest reading lots of code and picking out the differences for yourself. As for your question, // doesn't indicate rather the code is C++ or Java. // is simply a comment, and it's a comment in C++ and Java. Perhaps someone could correct me if I'm wrong, but I don't think a /**/ comment is a Java comment. I believe that's exclusively a C++ comment, but I may be wrong. |
Re: how to tell C++ from Java source code?
Quote:
|
Re: how to tell C++ from Java source code?
:
:
|
| All times are GMT -5. The time now is 10:06 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC