Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-13-2007, 09:28 PM
Member
 
Join Date: Dec 2007
Posts: 13
cew27 is on a distinguished road
need a little explanation
right first off i will introduce my self
i am 15 currently living in scotland uk and i am interested i java programming
i am told it is the best programming language to learn as there is the most demand for its programmers in the industry and because it is supposedly the "best" oop language.
at the moment i am learning the language from java for dummies (4th edition) by barry burd and i'm enjoying it.
but i am slightly confused about some part of java .... here are a few questions
1 how can java be run on all operating systems ?, is it compiled as either an exe or a mac file (not sure on name) or are the programs different formats?
2 when creating a applet does it use the same code as a normal java app? if so does this mean you can just create an applet in an ide and program like normal ( to put it crudely)
and the final question .... what are ajax and javascript usefull for ?

i have googled these questions but none of the results answer my main query

thanks
replys appretiated
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-13-2007, 09:37 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
1. Java has an interpreter and classes (the compiled java codes) are binary files that can be interpreted by java interpreters. Java is platform independent because of that special format that can be interpreted. To run your existing java codes, you only need to write the java interpreter on that platform and then you can run same class files on any platform.

2. Yes applets are in the same binary format and again all you need to have a java interpreter for your browser or a bridge for your browser to access the interpreter for that OS/platform!

3. I don't know much details but Ajax and javascript are for web only. Ajax is an extension of javascript for better user experience on web. You should read a little bit about it. Then you can understand better yourself when you see in which purpose they are used for. It is difficult for me to defien them but if you have more specific questions related to java i might help..
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 12-13-2007, 09:58 PM
Member
 
Join Date: Dec 2007
Posts: 13
cew27 is on a distinguished road
thanks for the reply but im still a but confused about the class and how it is "ran" when i compile the java source code it creates a .class file but this isnt regocnisable by the os (windows vista) and i can only run it via cmd?
at the moment i am only creating programs that display text in commad promt.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-13-2007, 10:24 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
java command is the interpreter i was talking about! So for linux you need another native application to run java classes (e.g. /usr/local/java1.6/jre/java)

So the format of class files are platform independent but you still need different interpreters to run these class files on different platforms.

Think about a c/c++ program, when you compile it it is only executable for that platform (mac/linux intel/sparc...), but this is not the case, compiled java codes can be run anywhere. Hope it is more clear for you now.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 12-13-2007, 10:30 PM
Member
 
Join Date: Dec 2007
Posts: 13
cew27 is on a distinguished road
im afraid i dont ... i dont want to annoy you but for proper java programs (e.g. the ones the companies use to check stock) the file format is a class file?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 12-13-2007, 11:36 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Quote:
the file format is a class file?
Yes. Do you have any reason not to believe this

You might start by reading these:

Interpreted language - Wikipedia, the free encyclopedia
Bytecode - Wikipedia, the free encyclopedia
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 12-13-2007, 11:56 PM
Member
 
Join Date: Dec 2007
Posts: 13
cew27 is on a distinguished road
i understand the concepts i was just confused as i cant seem to run the java programs exepts from the command line and i always thaight java programs were execute as .jars or something
sorry for being a n00b
Bookmark Post in Technorati
Reply With Quote
  #8 (permalink)  
Old 12-14-2007, 12:39 AM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
These are normal if you begin learning sth new.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class explanation mcal New To Java 1 02-05-2008 07:50 PM
Explanation bout threading and concurrency? cruxblack New To Java 1 08-10-2007 11:33 AM
I need didactic explanation Eric New To Java 2 07-02-2007 06:37 AM


All times are GMT +3. The time now is 03:07 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org