Transcript Document

Java
Daniul Byrd
History
• Development started in early 1990’s with Patrick
Naughton, James Gosling, and Mike Sheriden at Sun
Microsystems.
• Goal was to create a language similar to C++, while
making a safer and making it less tedious
• First publicly released in 1995
• Write Once, Run Everywhere
Overview
• Object-Oriented
• Java APIs
• Statically scoped variables
• Objects use explicit heap dynamic binding
• Identifiers – unlimited length string of letters and numbers, but
must begin with a letter
Abstract Data Types and
Encapsulation
• ADTs can be easily created using classes.
• Data members can be declared as Private to deny
outside access
• No operator overloading
Exceptions
• Exceptions implemented as classes
• User can define their own exceptions by creating a subclass of the
Exception class
• User defined exceptions can either be thrown by declaring an
object of the user defined class or using
throw new UserException();
• Use try{} … catch(exception type){} blocks, with optional finally{}
Event Handlers and Concurrency
• Event handling support included in java.awt and Swing libraries
• Add either named or anonymous event handlers to objects
• Concurrency provided through the Thread class.
• Create subclasses of the Thread class with a run() method
• After declaring a thread, it is started with aThread.start()
• When the program needs to wait for a thread use its join() method
Evaluation
• Easy to learn
• Safer to use than C++
• Widely used
• Multiplatform
• Free Compilers/IDEs