100%(1)1 out of 1 people found this document helpful
This preview shows page 23 - 33 out of 103 pages.
28Why Learn Java?
29Why Learn Java?
30§Java SE 8 is usable via JDK 8, which can be obtained from free (downloaded) or as part of a commercial development environment (such as NetBeans IDE)§The JDK consists of:§Java development tools, including the compiler, debugger and interpreter§The Java class libraries – rich collections of existing classes and methods (also known as Java APIs – Java Application Programming Interfaces)Java SE 8
31§Demo programs§Supporting tools and components§Commercially available integrated development environments (IDEs) allow these components to be used together in a user-friendly, productive way§We will use both the basic command line version (cmdunder Windows) of the JDK and an IDEJava SE 8
32§The standard JDK compiler is called “javac”§Compiling, Interpreting and JVM
33§For command line running of ordinary programs (called ‘application programs’), we use the interpreter “java” (appropriate versions of this are supplied for Windows, Linux, Mac OS and Solaris)Compiling, Interpreting and JVM
34§IDEs use “java” or their own versions§Most modern browsers can run compiled applets§The compiled Java program, in byte-code, should run in (almost) exactly the same way under different operating systems (Java is architecture neutral)§We say that the byte-code is being run on a Java Virtual Machine(JVM) and that various interpreters are implementations of the JVMCompiling, Interpreting and JVM
36§The syntax of both languages is very similar but with a number of minor (but important) differences§The selection (if, if-else, switch-case) and iteration (for, while, do-while) constructs you have used in C are virtually identical in Java except that Java has a booleandata type (and keywords false/truefor use in boolean expressions)Differences Between Java and C