• Forum
  • Lounge
  • little general knowledge question not fo

 
little general knowledge question not found on google

can a virus made in java hack a computer that runs on c++ entirely or vice versa.Do you know of anything similar if you understand what i ask.Like making a virus in one language to hack a computer that does not know about that language.
Can a virus be cross language like a virus made from c++ and html.
No computer exists that understands either C++ or Java. Computers only understand their own machine language.

If there existed a computer architecture whose machine language was C++ (i.e. its executable files would be C++ text files), then no, it would not be possible to run files written in any other programming language, including Java. It would be analogous to trying to run an Android app (ARM) on a desktop computer (x86).

HTML is not a programming language. It can't be used to make programs, let along viruses.
We can write instructions for the machine however we wish, in whatever language we wish. But before executing them, we need to interpret those instructions in a way the machine can understand.

On a hypothetical computer whose machine language was C++, it would be possible to run a Java program if and only if we had a program (specified in C++) that translated Java into C++, or a program which followed the instructions specified by a Java program. Such programs are called compilers and interpreters, respectively.
Last edited on
you mean like i send a virus made in c++ on a computer whose machine language is java, then i would i have send codeblocks along with it?

and then how did ransom ware which was made with c# work on windows pc?
you mean like i send a virus made in c++ on a computer whose machine language is java, then i would i have send codeblocks along with it?
To my knowledge, Code::Blocks doesn't support Java.
You would need to send a C++-to-Java transpiler.

and then how did ransom ware which was made with c# work on windows pc?
You could just as well ask how Windows computers are able to run programs made in C++, when the underlying platform doesn't understand C++. The fact is, what language a program is developed in tells you nothing about whether a particular platform will be able to execute the final product.
Registered users can post here. Sign in or register to post.