Results 1 to 8 of 8
Thread: need a little explanation
- 12-13-2007, 08:28 PM #1
Member
- Join Date
- Dec 2007
- Posts
- 13
- Rep Power
- 0
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
- 12-13-2007, 08:37 PM #2
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..
- 12-13-2007, 08:58 PM #3
Member
- Join Date
- Dec 2007
- Posts
- 13
- Rep Power
- 0
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.
- 12-13-2007, 09:24 PM #4
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.
- 12-13-2007, 09:30 PM #5
Member
- Join Date
- Dec 2007
- Posts
- 13
- Rep Power
- 0
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?
- 12-13-2007, 10:36 PM #6
Yes. Do you have any reason not to believe this :)the file format is a class file?
You might start by reading these:
Interpreted language - Wikipedia, the free encyclopedia
Bytecode - Wikipedia, the free encyclopedia
- 12-13-2007, 10:56 PM #7
Member
- Join Date
- Dec 2007
- Posts
- 13
- Rep Power
- 0
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
- 12-13-2007, 11:39 PM #8
Similar Threads
-
Class explanation
By mcal in forum New To JavaReplies: 1Last Post: 02-05-2008, 06:50 PM -
Explanation bout threading and concurrency?
By cruxblack in forum New To JavaReplies: 1Last Post: 08-10-2007, 10:33 AM -
I need didactic explanation
By Eric in forum New To JavaReplies: 2Last Post: 07-02-2007, 05:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks