Download Computer Programming 2

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Computer Programming 2
Why do we study Java….
Java is Simple
 It has none of the following:

operator overloading, header files, preprocessor, pointer arithmetic, structures,
unions, multi-dimensional arrays, templates,
multiple inheritance, or implicit type conversion
Java is internet friendly
 Java programs are transmitted as byte-
codes, which means it is possible to
download a Java program to any computer
on the Internet and execute it.
Java is a dynamic and distributed
language
 Any Java class can be loaded dynamically
into a running Java interpreter at any time.
Java also provides a lot of high-level support
for networking, making it the preferred
language for network applications.
Java is Object-Oriented.
 Java is a fully object-oriented language with
strong support for proper software
engineering techniques. Almost everything
in Java is an object (simple types like
numbers and booleans are not). Java code
is organized into classes endowed with a
single-inheritance property. This decision, to
start with a clean object-oriented slate, has
been vindicated by the ease with which
various extensions have been created.
Java is Architecture Neutral
(portable )
 Because Java programs are compiled to
bytecodes, they can run on any platform that
supports Java. The Java language is the
same on every computer. Java bytecodes
help make "write once, run anywhere"
possible.
Java is free
 Free compiler from the developers, the JDK
(Java Developer’s Kit), is available at no
charge from the Sun Microsystems at
http://java.sun.com/.
Java is Statically (Strongly) Typed
 In a Java program, the type of the objects
(numbers, characters, arrays, etc.) that are
used must be defined. However, all object in
the Java system also have a dynamic type.
Most of Java’s type checking is done at
compile time, but some runtime checks are
still required, such as array bounds checking
and null pointer checking.
Java is Multi-Threaded
 Most operating systems today (UNIX,
Windows, etc.) support multi-tasking, i.e.,
they can perform more than one task at a
time. A Java program can execute more
than one thread at a time and it can take
advantage of multiprocessor machine.
Java is Garbage Collected
 The Java system has a built-in program
called the garbage collector that scans
memory and automatically frees any
memory chunks that are no longer in use.
Java is Robust
 Java programs can’t cause a computer to
crash. This does not mean that Java
programs don’t have bugs.
Java is Small
 It can run efficiently on personal computers
with 4 Mb of RAM or more. The Java
interpreter takes up only a few hundred
kilobytes.
Java is Secure
 Java programs have no pointers, and byte-
code programs like Java are strongly typed,
so it is possible to verify a Java program
before executing it. Web browsers to make
sure that applets do not contain viruses use
this verification.
Java is Extensible
 It is possible to interface Java programs to
existing software libraries written in other
languages.
Java is Well Understood
 . Java’s cool features are derived from other
languages such as Lisp, Smalltalk, Pascal,
Cedar, Objective-C, Self, Beta, and mostly
C++. The language is new but the underlying
technology is not
Java is Fun
 It is harder to make stupid mistakes, and it is
easier to be productive.
Java is the language of the AP exam
 It is possible to get college credit. Last year a
student scored a 5 on the AP exam!
Java can get you a job
 Go on the internet and let’s see
1. How many jobs we can find in our area
2. What is the salary range that these jobs pay.