Home arrow Java arrow Page 2 - Getting Started with Java

Getting Started with Java

This article introduces you to the Java programming language. The first of two parts, it is excerpted from chapter one of Sams Teach Yourself Java 2 in 21 Days, 4th Edition, written by Rogers Cadenhead and Laura Lemay (Sams; ISBN: 0672326280).

Author Info:
By: Sams Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 12
May 04, 2006
  1. · Getting Started with Java
  2. · Introduction to Java
  3. · Selecting a Development Tool
  4. · Object-Oriented Programming
  5. · Objects and Classes
  6. · Attributes and Behavior

print this article

Getting Started with Java - Introduction to Java
(Page 2 of 6 )

Java is an object-oriented, platform-neutral, secure language designed to be easier to learn than C++ and harder to misuse than C and C++.

Object-oriented programming (OOP) is a software development methodology in which a program is conceptualized as a group of objects that work together. Objects are created using templates called classes, and they contain data and the statements required to use that data. Java is completely object-oriented, as you'll see later today when you create your first class and use it to create objects.

Platform neutrality is the ability of a program to run without modification in different computing environments. Java programs are compiled into a format called bytecode that is run by any operating system, software, or device with a Java interpreter. You can create a Java program on a Windows XP machine that runs on a Linux Web server, Apple Mac using OS X, and Palm personal digital assistant. As long as a platform has a Java interpreter, it can run the bytecode.

Note - This feature has typically been touted as a way to "write once, run anywhere" by Java admirers, including the authors of this book. However, practical experience with Java shows that there are always some inconsistencies and bugs in the implementation of the language on different platforms. For this reason, a more derisive slogan has been coined among some less-than-admirers: "write once, debug everywhere." Even so, the platform neutrality of Java makes it much easier to develop software that isn't locked into a single operating system or computing environment.

Though the ease of learning one language over another is always a point of contention among programmers, Java was designed to be easier than C++ primarily in the following ways:

  • Java automatically takes care of memory allocation and deallocation, freeing programmers from this tedious and complex task.

  • Java doesn't include pointers, a powerful feature of use primarily to experienced programmers that can be easily misused.

  • Java includes only single inheritance in object-oriented programming.

The lack of pointers and the presence of automatic memory management are two key elements to the security of Java. Another is the way that Java programs running on Web pages are limited to a subset of the language to prevent malicious code from harming a user's computer.

Language features that could easily be employed for harmful purposesósuch as the abilities to write data to a disk and delete filesócannot be executed by a program when it is run by a World Wide Web browser's Java interpreter.

For a longer discussion of Java's history and the strong points of the language, read Appendix A, "Choosing Java."

blog comments powered by Disqus

- 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 

Developer Shed Affiliates


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