I have no idea how C++ works, but I'd like to learn...

Is it possible to create java files/programs using C++?

Recommended Answers

All 4 Replies

I don't know any French. Is it possible to speak French using English? If you'd like to learn then don't post obscure questions that people can't even beging to answer. Do some googling and ask specific questions.

The specific question was, can you create java programs in C++

Yes, of course you can create java source files from c++. Once the java source code is created just run it though a java compiler.

It depends on what you mean. If you mean can you create an c++ application that produces a App.java? The answer is yes, but this is probably not what you are thinking about (a way to do this is to use fstream and write to a text file and then call java compiler on that file).
But here is how programs generally work. There are 3 levels of code.
1. machine code //0's and 1's for all program it's the same assuming same maching
2. assembly code //made from level 3 and turn into level 1, different for individual level 3 language
3. high level //C++, java, ruby...each has it's own compiler that does different things with the code depending on the language.

So once your program is in an .exe format it's in 0's and 1's and it dosen't matter what language it's written in. But there is no way to use a java compiler to produce .o files for c++.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.