Programming in Java

Programming in JavaBesides C++ Java is now the most widely available and used object-oriented programming language. It is a very useful language that is successfully utilized by many programmers in many application areas. It is a reasonably carefully thoughtout language where the design is based partly on acknowledged principles and partly on solid experience and feedback from actual use. Java is a powerful but lean objectoriented programming language. It makes it possible to program for the Internet by creating applets, i.e. programs that can be embedded in a web page. For example, an applet can be an animation with sound, an interactive game, or a ticker tape with constantly updated stock prices. However Java is more than a programming language for writing applets. It also can be used for writing standalone applications. It seems it is becoming the standard language for both general-purpose and Internet programming. Java is close to C++. It has taken many features of C++, but unfortunately discarded some of them, for example templates and multiple inheritence. To this lean core it has added garbage collection (automatic memory management), multithreading (the capacity for one program to do more than one task at the time), and security capabilities. Java is a platform consisting of three components: (1) the Java programming language, (2) the Java library of classes and interfaces (Java has a huge number of built-in classes and interfaces), and (3) the Java Virtual Machine.

One of the biggest advantages Java offers is that it is portable. An application written in Java will run on all platforms. Any computer with a Java-based browser can run the applications or applets written in the Java programming language. The Java Virtual Machine (JVM) is what gives Java its cross-platform capabilities. The Java file is not compiled into a machine language, which is different for each operating system and computer architecture, Java code is compiled into byte-code (platform independent).
The Java programming language is object-oriented, which makes program design focus on what we are dealing with rather than on how we are going to do something. Object-oriented languages use the paradigm of classes. A class is an abstract data type (ADT). A class includes both data and the methods (functions) to operate on that data. We can create an instance of class, also called an object, which will have all the data members and functionality of its class. The class paradigm allows one to encapsulate data so that specific data values or methods implementations cannot be seen by those using the class. Encapsulation makes it possible to make changes in code without breaking other programs that use that code. Java also includes inheritance, this means the ability to derive new classes from existing classes. The derived class, also called a subclass, inherits all the data and methods of the existing class, referred to as the parent class. A subclass can add new data members to those inherited from the parent class. With respect to methods the subclass can reuse the inherited methods as is, change them, and/or add its own new method.

Website: issc.rau.ac.za | Filesize: 653kb
No of Page(s): 375
Click here to download Programming in Java .

Related Tutorial

Tags: , , , , , , , , , ,

Comments

Leave a Reply




Search engine terms: learning pseudocode tips,