Java Programming Flashcards
Computer language innovation and development occur for two fundamental reasons:
- To adapt to changing environments and uses
- To implement refinements and improvements in the art of programming
Java is a general purpose, Object oriented programming Language developed by ______ in ___. Originally called ___ by ____.
Sun Microsystems of USA
1991.
Oak
James Gosling.
Sun Microsystems decided to develop special software for consumer electronic devices headed by James Gosling.
1990
Using C++ the team announced a new language named Oak.
1991
The Green project team by Sun, shown new language to control home appliances using hand held device with tiny touch-sensitive screen.
1992
The www appeared on the internet and transformed the text based internet into graphical rich environment using Web Applets.
1993
Team developed a web browser called “HotJava” for web Applets,
1994
“Oak” was renamed “Java” due to some legal snags. Java is just a name. Netscape and Microsoft supports to Java.
1995
Java established itself as a leader for internet & general purpose programming. Java founds its home.
1996
– Object Oriented Programming Languages supports three main features: encapsulation, inheritance, and polymorphism.
– capability to reuse code.
Object Oriented
– Most of the Java syntax was based from C and C++
– Migrating to Java would be very easy.
– Instead of pointers, Java uses the concept of references.
Simple
– Java applications can run several threads
– Multithreading is extremely useful in practice.
– For example, a browser should be able to simultaneously download multiple images
Multi-Threaded
– Java applications can run several threads
– Multithreading is extremely useful in practice.
– For example, a browser should be able to simultaneously download multiple images
Multi-Threaded
– Java applications can run across most types of network.
Network Aware
– One of the nice things about Java is its capability to run in most platforms once you’ve compiled it.
– WORA – Write Once, Run Anywhere
Cross Platform / Platform Independent
– it runs the applications on top of the Java Virtual Machine (JVM) and your JVM sits on top of your operating system
– Your Java application does not have a direct attachment or a direct contact with your operating system
Secure
– Using Java, you can also create Graphical User Interface (GUI) Applications which enables the user to make use of Buttons, Frames and TextFields
– Java has a built-in Abstract Window Toolkit (AWT) which makes use of the standard GUI components
– Besides AWT, Java also supports Java Foundation Classes (JFC) / Swing, which is supported under the javax (java extension) package.
Supports GUI
You can freely download the JDK and its documentation at the Oracle website.
100 % Free –
DIFFERENCE OF JAVA & C++
Java does not support operator overloading.
Java does not have template classes.
Java does not support multiple Inheritance.
Java does not support global variables.
Java does not use pointers.
Java has replaced the destructor function with finalize method.
There are no header files in Java.
3 JAVA FLAVORS
- Java Standard Edition (JSE)
- It is widely used platform for computer programming in Java - Java Enterprise Edition (JEE)
-It has extra libraries which can be used to develop JEE applications - Java Micro Edition (JME)
-It is used to design for embedded systems.
Example: Android
an application that Java developers should have in their machine.
Java Development Kit (JDK)
is the interpreter that needs to be installed by a Java Technology Application user.
Java Runtime Environment (JRE) -
JAVA RUNTIME ENVIRONMENT (JRE) components
Java Virtual Machine (JVM) – is a virtual machine whose purpose is to execute other programs.
Application Programming Interface (API) – set of rules that controls the interaction between software.
_____ can read compiled byte codes
The __- can also be customized
Majority of the objects type is being checked by the compiler
Java Virtual Machine
_____ is the process of deallocating memory (heap) spaces that is no longer needed
Garbage Collection
pieces of information that are sent to a method
Arguments
use to define Java class using any name.
Identifier
also known as “Pascal casing.
Upper Camel Casing
style that joins words which each word begins with an uppercase letter.
UCC
specifies the accessibility or scope of a field, method, constructor or class.
Access specifiers
Types of Java Access Specifier
Private
Public
Protected
Default
Public -
Private –
Protected –
Default –
1 access level is everywhere, accessed within class, outside class, within package and outside the package.
2 access level is only within the class.
3 access level is within package and outside the package through child class.
4 access level is only within the package
Types of indentions:
K & R Indention
– named after Kernighan & Ritchie (wrote the first book in C language)
Allman style – named after Eric Allman (popularized the style)
These are ignored by the compiler.
It is used by the programmer to leave notes for themselves and for those who might read their programs in the future.
It is also used to help out the programmer to locate the possible error of the program by commenting out some statements that may cause the error.
It is the “eraser” of programmers.
comments
TYPES OF COMMENTS
Line comment - It starts with 2 slashes (//)
Block Comment – It starts with (/) and ends with (/)
Javadoc – special case of block comments.
- It starts with (/**) and ends with (*/)
There can be 3 output after compiling:
No message – success compilation
Programming language error – syntax error in the code.
Javac not recognized error