Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Uses C?

 
Sahil Reddy
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello pals

Some of us are discussing the following and are unable to come to some conclusion ......so decide to ask the geeky people over here....

1. Does JAVA code converts into C Code ?
2. Does JAVA code uses C Code ?
3. Is it possible to write JVM which does not use any C language and converts directly to Assembly.
4. Is it possible to use JAVA language to access memory similar to the way we use pointers in C Language ?

Thanks and Regards
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sahil Reddy wrote:Hello pals

Some of us are discussing the following and are unable to come to some conclusion ......so decide to ask the geeky people over here....

First, it's "Java", not "JAVA". It's not an acronym.

1. Does JAVA code converts into C Code ?


No. Java source is compiled into Java bytecode.

2. Does JAVA code uses C Code ?


Depends what you mean by "Java" and what you mean by "uses". The most commoin JVM implementations are written partially in C or C++, but it's not a requirement.

3. Is it possible to write JVM which does not use any C language and converts directly to Assembly.


What do you mean?

A JVM is typically written partly in C or C++ and partly in Java. When it's executing, it converts the Java bytecodes to the machine language for the platform on which it's running. You seem to think that there's a conversion to C code in the middle. That's not the case. You also seem to think that "Assembly" is a single language. It's not. Each architecture has its own machine language, and each of those has its own assembly language (possibly more than one, at least in theory).

4. Is it possible to use JAVA language to access memory similar to the way we use pointers in C Language ?


No.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeff Verdegan wrote:
4. Is it possible to use JAVA language to access memory similar to the way we use pointers in C Language ?


No.

But it is possible to write C code and integrate that into Java, using JNI.
 
Randall Twede
Ranch Hand
Posts: 4396
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
native method calls(that must be what JNI stands for). you can call c or c++ code from a java program. you can maybe even call VB code for all i know.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java, not JAVA. It's not an acronym.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic