Getting Ready for Java What is Java n

  • Slides: 13
Download presentation
Getting Ready for Java

Getting Ready for Java

What is Java? n n n Java is a programming language: a language that

What is Java? n n n Java is a programming language: a language that you can learn to write, and the computer can be made to understand Java is currently a very popular language Java is a large, powerful language n n but it is not simple! Compared to C++, Java is elegant 2

Declarations, statements, comments n n A declaration gives some information to the computer A

Declarations, statements, comments n n A declaration gives some information to the computer A statement tells the computer to do something n n Statements should really be called “commands” Comments are ignored by the computer—they are explanations of your program for human beings to read 3

Syntax and semantics n Syntax is the “grammar” of the language n n n

Syntax and semantics n Syntax is the “grammar” of the language n n n The syntax of Java is large, but finite Syntax must be absolutely correct The computer will point out every syntax error Error messages may be helpful or misleading Semantics is the “meaning” of your program n n Semantic errors cause your answers to be wrong You may or may not get error messages 4

Two aspects of Java n Java has syntax and semantics n n This is

Two aspects of Java n Java has syntax and semantics n n This is where you begin It is possible to learn everything about Java’s syntax and semantics We will cover most of Java’s syntax and semantics Java also has “packages” n n n Packages are sort of like vocabulary bundles To be good at Java, you need to learn many packages There are more Java packages than you can ever learn 5

Versions of Java n Java 1 n n n Java 2 n n Java

Versions of Java n Java 1 n n n Java 2 n n Java 1. 0: Original, not very good version Java 1. 1: Greatly revised and improved Java 1. 2: Includes “Swing” Java 1. 3: More new packages, no new syntax Java 1. 4: Introduces the assert statement Java 5 n Java 1. 5: Quite a bit of new syntax 6

Vocabulary I n JRE, Java Runtime Environment n n JDK, Java Development Kit (previously

Vocabulary I n JRE, Java Runtime Environment n n JDK, Java Development Kit (previously called SDK, System Development Kit) n n n This is the software that allows you to run Java programs on your computer The software that allows you to create and run Java programs on your computer When you install the SDK, you get a JRE along with it IDE, Integrated Development Environment n A tool that makes it easier to write programs 7

Vocabulary II n Beta software n n Interface n n n Software that is

Vocabulary II n Beta software n n Interface n n n Software that is new, untested, often buggy the place where things touch each other the way that distinct things communicate GUI, Graphical User Interface n A way for the computer and the user to communicate via graphics (pictures) on the screen 8

Blue. J n Blue. J is an IDE (Integrated Development Environment). It includes n

Blue. J n Blue. J is an IDE (Integrated Development Environment). It includes n n n an editor, which you use to write your programs a debugger, to help you find your mistakes a viewer, to see the parts of your program an easy way to run Java programs an easy way to view documentation 9

Elegance n n n Powerful software can do everything you want to do--for example,

Elegance n n n Powerful software can do everything you want to do--for example, Microsoft Word Complex software is hard to learn and hard to use-for example, Microsoft Word More power usually means more complexity Elegant software somehow manages to be both powerful and simple Blue. J is elegant n Unfortunately, it’s also a bit buggy 10

What You Need n n 128 MB of RAM (256 MB recommended) 500 MHz

What You Need n n 128 MB of RAM (256 MB recommended) 500 MHz Pentium or better n n n Java JDK 1. 5 (includes JRE) Blue. J 2. 0. 5 or better n n n Macintosh: must run Mac OS X, preferably Panther (10. 4) Earlier versions of Blue. J have serious problems If you have an older version, update! By the way: the JDK and Blue. J are free 11

Getting Ready n If you plan to use your own computer: n Download and

Getting Ready n If you plan to use your own computer: n Download and install Java JDK 1. 5 n n n http: //java. sun. com/j 2 se/1. 5. 0/download. jsp Download the JDK, not the JRE If your computer can’t run Java 1. 5, get Java 1. 4. 2 [Optional, but strongly recommended] Download the Java 1. 5 documentation from the same location Download and install Blue. J 2. 0. 5 or newer n http: //www. bluej. org/ 12

The End 13

The End 13