Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Basics - Prashant Nagaraddi. Features of Java n Java syntax is similar to C/C++ but there are many differences too n Java is strongly typed like.

Similar presentations


Presentation on theme: "Java Basics - Prashant Nagaraddi. Features of Java n Java syntax is similar to C/C++ but there are many differences too n Java is strongly typed like."— Presentation transcript:

1 Java Basics - Prashant Nagaraddi

2 Features of Java n Java syntax is similar to C/C++ but there are many differences too n Java is strongly typed like C++ u Type inconsistencies are detected at compile time n Java is an Object-Oriented Language u Computation is achieved via interacting objects (more on this later)

3 Features of Java n Java is an interpreted language u Java source code is translated into Java bytecodes by Java compiler u These form the instructions to a Java Virtual Machine (Java VM) u The Java VM interprets the bytecodes and as a result, executes real machine instructions Hello.javaHello.classjavacjava Source Codebytecode compilerbytecode fileInterpreter (VM)

4 Features of Java n Java bytecodes are machine independent u This means that you can F compile Java source code on one platform F transfer the bytecodes to another platform and F execute them using a Java VM that has been ported for that platform u You can also send Java bytecodes around the Internet as data. Sending code around in this manner is called providing executable content

5 Running the Java Compiler (javac) and Interpreter (java) n On the CS dept. Solaris systems u the latest compiler, interpreter and class sources (J2SE) are in the directory /usr/j2se F the compiler and interpreter are in the /usr/j2se/bin directory. This should be included in your PATH u to run the compiler, just give the name of a.java file F % javac Hello.java u to run the interpreter, give the name of the bytecode file without the.class extension F % java Hello F Hello, World

6 Running the Java Compiler (javac) and Interpreter (java) n On Windows 9x/2000/NT u you can compile and run your programs using F the Java 2 Standard Development Kit (SDK) for Windows Latest I’ve tried is J2SEv1.3 available from http://java.sun.com Add the “bin” directory in your java directory to your DOS PATH Compile and run just like in Solaris F a commercial Java Interactive Development Environment (IDE) such Visual J++ ( http://msdn.microsoft.com/visualj/) CodeWarrior (http://www.metroworks.com) VisualCafe (http://www.visualcafe.com)


Download ppt "Java Basics - Prashant Nagaraddi. Features of Java n Java syntax is similar to C/C++ but there are many differences too n Java is strongly typed like."

Similar presentations


Ads by Google