Search Java Tutorials

Custom Search

What You Will Want to Complete This Tutorial?

You must have at least 1st and 2nd pre-requirements to start the tute. Other requirements will require for last chapters only. These all are free to use and download!
  1. Java Development Kit Standard Edition (JDK / J2SE) Any Version(www.java.com)
  2. Any Text Editor (Note Pad quite enough or get Notepad++ from (http://notepad-plus.sourceforge.net)
  3. Java Run Time Environment (JRE) Any Version(www.java.com)
  4. Java Enterprise Edition (J2EE) for advanced developing (For last few chapters)(www.java.com)
  5. Java Wireless Toolkit for Mobile Application Development (For Mobile Application Development Chapters) (www.java.com)
  6. Tomcat Web Server to run Servlets. (www.tomcat.apache.org/)
Your operating system may be any version of Windows.
What will you learn (As a summary)?
  1. How to build console and windowed applications using Java
  2. How to build web page elements with Java Applets
  3. How to build Database Programs with Java
  4. How to build enterprise applications with Beans
  5. How to add Email functions to Java programs
  6. How to program smart devices (Phone, PDA etc…) with Java

Features of Java and Object Oriented Programming

Features of Java

Java is;

  1. Simple
  2. Object Oriented
  3. Compiled And Interpreted
  4. Multithreaded
  5. Secure
  6. Portable
  7. Garbage Collection Enabled
  8. Architecture Natural

Java follows Object Oriented Programming Techniques (OOP). OOP involves creating objects within the program and enable the program to use those objects. For example, you may create your own short note book that will use before you go to exam. Objects are made up of States (attributes) and Methods. For example your short note book has ‘short’ text and it is a ‘note’. ‘Short’ and ‘Note’ are attributes of Short Note book. What you’ll do with it is ‘Read’ or ‘Write’ short notes. ‘Read’ and ‘Write’ are methods.

A Collection of Objects that have common attributes and metho

ds are known as a ‘Class’. For example ‘small’ children class and ‘big’ children class, where all small children can ‘dance’, but big children have to ‘learn’. So there we got “Small Children Class” and “Big Children Class”.

But all of them are ‘Children’. So you can group those two classes into one class ‘Children’. This ‘mega’ class known as “Parent Class” in Java, while those children classes known as “Child Classes’. Parent classes are also known as ‘Super Classes’ while Child classes known as ‘Sub Classes’.

We build our own classes in java and it’s already have prewritten classes. When we build our programs we will use these prewritten classes as an ‘instance’ to our program. That means we use an object to use that class. For example, to watch DVDs we use DVD player. Movie or Video will be the class and we will enjoy watching it.

When we create classes we divide it into logical portions (groups) known as procedures. This make easier to track operations within our program.

Important: A Java class provides common implementation for a set of similar objects. It does so by defining a set of methods and data variables. Unlike Java class, a Java interface merely describes a common public behavior of similar objects. Therefore, it contains a set of method declarations. A Java class may implement an interface by providing implementation for the interface methods. Java uses another construct called package to organize them (Package = Classes + Interfaces). A Class is the specification of objects. A Class must therefore declare where to store the states of each object and how the behavior of object implemented. Java does not allow extending from multiple classes, it may implement multiple interfaces.

OOP Features in Java

  1. Encapsulation
    1. Encapsulation is hiding the implementation of program. For example when we watch DVD, we don’t know how exactly DVD player played it because of its outer cover. Therefore we will aware of its internal functions. This will protect its internal components from unauthorized access. There are two kinds of encapsulation: encapsulation for information hiding and encapsulation for modularity.
  2. Inheritance
    1. Reusing existing classes again and again is Inheritance. This will reduce programmer work load. For example we do not want to trouble about how to use our new TV. Because we got a old TV and probably we can do some old fashioned work with new one too!
  3. Polymorphism
    1. Polymorphism is versatility. Same Object will behave in verity according to situation. For example you’ll buy a TV because you want one. But sometimes you’ll buy a TV because it’s free with $50000 Home Theater System.
  4. Abstraction
    1. Ignoring unnecessary details and extracting important details known as Abstraction. Garbage Collection is a important OOP feature of Java. We will discuss about this later.

Tip: OOP is simply a way of thinking about problem and their solutions. Instead of tackling the problem in a procedural way, OOP attempts to break down a problem into component objects. The solution focuses on these independent objects and their relationship with each other.

No comments: