Professional Documents
Culture Documents
Intro to Java
Java
programming language
Characteristics of Simple Secure Portable Object-oriented Robust Multithreaded Architecture-neutral Interpreted High performance Distributed Dynamic
Java
How it works!
Java is independent only for one reason: Only depends on the Java Virtual Machine (JVM), code is compiled to bytecode, which is interpreted by the resident JVM, JIT (just in time) compilers attempt to increase speed New release of Java is improving the speed a lot Just-in-time (JIT) compiler: convert byte codes to native machine language on the fly
Cont . Java is an object-oriented language, with a syntax similar to C Structured around objects and methods A method is an action or something you do with the object Avoid those overly complicated features of C++: Operator overloading, pointer, templates, friend class, etc.
Things to notice
Java is case sensitive. whitespace doesnt matter for compilation. File name must be the same as one of the class names, including capitalization!. At most one public class per file. If there is one public class in the file, the filename must be the same as it.
Method overloading
As long as the methods have different parameter lists
Object-Oriented Programming
Understanding OOP is fundamental to writing good Java applications Improves design of your code Improves understanding of the Java APIs\ There are several concepts underlying OOP: Abstract Types (Classes) Encapsulation (or Information Hiding) Inheritance Polymorphism
javap - to print the Java bytecodes javaprof - Java profiler javadoc - documentation generator javah - creates C header files