



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to the java programming language in the context of cs-506, web design & development. It covers the design goals of java, its buzzwords, language features, libraries, and benefits such as simplicity, object-oriented nature, distributed capabilities, robustness, security, portability, high-performance, and multi-threading. Java's compiler structure and programmer efficiency are also discussed.
Typology: Lecture notes
1 / 6
This page cannot be seen from the preview
Don't miss anything!




This handout is a traditional introduction to any language features. You might not be able to comprehend some of the features fully at this stage but don’t worry, you’ll get to know about these as we move on with the course
The massive growth of the Internet and the World-Wide Web leads us to a completely new way of looking at development of software that can run on different platforms like Windows, Linux and Solaris etc.
Java came on the scene in 1995 to immediate popularity.
Before that, C and C++ dominated the software development
Java brings together a great set of "programmer efficient" features
From the original Sun Java whitepaper: " Java is a simple, object-oriented, distributed, interpreted, robust, secure, architecture-neutral, portable, high- performance, multi-threaded, and dynamic language. "
Here are some original java buzzwords...
Java has two parts...
checking. (Or put the other way, C can be faster since it doesn't check anything.)
The JVM "verifier" checks the code when it is loaded to verify that it has the correct structure -- that it does not use an uninitialized pointer, or mix int and pointer types. This is one-time "static" analysis -- checking that the code has the correct structure without running it.
The JVM also does "dynamic" checking at runtime for certain operations, such as pointer and array access, to make sure they are touching only the memory they should. You will write code that runs into
As a result, many common bugs and security problems (e.g. "buffer overflow") are not possible in java. The checks also make it easier to find many common bugs easy, since they are caught by the runtime checker.
You will generally never write code that fails the verifier, since your compiler is smart enough to only generate correct code. You will write code that runs into the runtime checks all the time as you debug -- array out of bounds, null pointer.
Java also has a runtime Security Manager can check which operations a particular piece of code is allowed to do. As a result, java can run untrusted code in a "sandbox" where, for example, it can draw to the screen but cannot access the local filesystem.
"Write Once Run Anywhere", and for the most part this works.
Not even a recompile is required -- a Java executable can work, without change, on any Java enabled platform.
Java provides an extensive support for the development of web and enterprise applications
Servlets, JSP, Applets, JDBC, RMI, EJBs and JSF etc. are some of the Java technologies that can be used for the above mentioned purposes.
The first versions of java were pretty slow.
Java performance has gotten a lot better with aggressive just-in-time-compiler (JIT) techniques. Java performance is now similar to C -- a little slower in some cases, faster in a few cases. However memory use and startup time are both worse than C.
Java performance gets better each year as the JVM gets smarter. This works, because making the JVM smarter does not require any great change to the java language, source code, etc.
Java has a notion of concurrency wired right in to the language itself.
This works out more cleanly than languages where concurrency is bolted on after the fact.
Class and type information is kept around at runtime. This enables runtime loading and inspection of code in a very flexible way.
The source code for each class is in a .java file. Compile each class to produce “.class” file.
Sometimes, multiple .class files are packaged together into a .zip or .jar "archive" file.
On unix or windows, the java compiler is called "javac". To compile all the .java files in a directory use "javac *.java".
Faster Development