Home arrow Java arrow Page 3 - Java Part 1: The Basics
JAVA

Java Part 1: The Basics


Java is arguably the hottest programming language today. It can be used cross platform to build complete applications, applets and even web pages. In this 10 part series of articles, Chris will explain what Java is, and also provide working examples, clearly describing the Java language syntax.

Author Info:
By: Chris Noack
Rating: 4 stars4 stars4 stars4 stars4 stars / 9
November 20, 2001
TABLE OF CONTENTS:
  1. · Java Part 1: The Basics
  2. · The whats, hows and cans
  3. · What are objects?
  4. · One Name: Many Uses
  5. · Conclusion

print this article
SEARCH DEVARTICLES

Java Part 1: The Basics - What are objects?
(Page 3 of 5 )

Objects in Java and other object-orientated languages contain both data members and the methods (functions) that operate on those members.

Because of this, encapsulation is achieved and objects will function more reliably with other independent code. Objects are simply instances of classes. Methods and members that are contained within an object are accessible with the dot (.) operator, such as myObject.DoWork(). We will explore objects later in the series.

Why code twice when once will do?

The answer?... Don't! As well as any user defined classes that one may wish to implement, Java comes with a great many predefined classes so one need not re-invent the wheel every time new code is needed. This can greatly expedite the coding and design process.

In Java, classes can be extended from existing classes. The descendant class extends its parent class by inheriting its attributes and defining extra ones. This is called inheritance. Inheritance is useful when a class is very similar to another class, but needs additional methods or members. Inheritance saves a lot of code duplication.

Another example of a form of inheritance is class abstraction. Abstract classes and their descendents make use of the same methods, although the methods for each descendent class will perform different actions specific to the nature of the class. This is a powerful feature of the object-orientated paradigm that will also be explored in more detail later down the track.
blog comments powered by Disqus
JAVA ARTICLES

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials