Java was developed from a language which could be used on many different

Java was developed from a language which could be

This preview shows page 23 - 33 out of 103 pages.

28Why Learn Java?
Image of page 23
29Why Learn Java?
Image of page 24
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
Image of page 25
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 ( cmd under Windows) of the JDK and an IDE Java SE 8
Image of page 26
32§The standard JDK compiler is called “javac§ Compiling, Interpreting and JVM
Image of page 27
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
Image of page 28
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 JVM Compiling, Interpreting and JVM
Image of page 29
Image of page 30
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 boolean data type (and keywords false/true for use in boolean expressions) Differences Between Java and C
Image of page 31
37 §
Image of page 32
Image of page 33

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture