Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 two questions
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
memocool




PostPosted: Wed Dec 20, 2006 10:31 am   Post subject: two questions

hi there
i'm new in this forum n i'm really happy here cuz i wanna be a member in programming's world .
i have two question n i hope you help me
1) what's the different between compiler n interpreter?
i have answer but i'm not sure .compiler converts the program into machine code n the interpreter converts it into bytecode n java uses them both .
is that the correct answer?
2) what's the different between
(system.out.println() and system.err.println() )? Sad
Sponsor
Sponsor
Sponsor
sponsor
wtd




PostPosted: Wed Dec 20, 2006 11:27 am   Post subject: Re: two questions

memocool wrote:
hi there
i'm new in this forum n i'm really happy here cuz i wanna be a member in programming's world .
i have two question n i hope you help me
1) what's the different between compiler n interpreter?
i have answer but i'm not sure .compiler converts the program into machine code n the interpreter converts it into bytecode n java uses them both .
is that the correct answer?
2) what's the different between
(system.out.println() and system.err.println() )? Sad


Classically, an interpreter parses a source file, and then interprets the resulting abstract syntax tree. Perl and Ruby both currently behave this way.

A compiler, on the other hand, produces machine code for some virtual machine, which is then executed by that virtual machine. Python and Java are popular examples of environments where code is compiled to machine code for a virtual machine. C and C++, on the other hand, are examples of languages that compile to machine code for a virtual machine which also happens to be implemented in hardware: the CPU in your computer.

To understand the difference between System.out.println() and system.err.println(), you must understan a few things.

Firstly that most operating systems have environments where there is a standard output channel, and a standard error channel. The advantage to separating them is that they can be routed to separate places.

For instance, I may wish not to view the standard output of a program, but I may very much wish to see any error messages it produces. I can route the standard output into oblivion, and keep the standard error messages printing to my screen.

Secondly, you must understand that out and err are static fields in the System class used to represent these two output channels. They both implement the println method.
memocool




PostPosted: Thu Dec 21, 2006 9:09 pm   Post subject: (No subject)

java interprets the source file into bytecode by using interpreter n them converts it to machine code by using the compiler right??
thank you very much
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: