Java is a programming language in the tradition of C and C++. As a result, if you have any experience with C or C++, you’ll find yourself in familiar territory often as you learn the various features of Java. Java differs from other programming languages in a couple of significant ways. The following sections describe the most important differences.
Java is a programming language in the tradition of C and C++. As a result, if you have any experience with C or C++, you’ll find yourself in familiar territory often as you learn the various features of Java. However, Java differs from other programming languages in a couple of significant ways. The following sections describe the most important differences. PLATFORM INDEPENDENCE One of the main reasons Java is so popular is its platform independence, which means that Java programs can be run on many different types of computers. A Java program runs on any computer with a Java Runtime Environment, also known as a JRE, installed. A JRE is available for almost every type of computer — PCs running Windows, Macintosh computers, Unix or Linux computers, huge mainframe computers, and even cell phones. OBJECT ORIENTATION Java is inherently object-oriented, which means that Java programs are made up of programming elements called objects. Simply put, an object is a programming entity that represents either some real-world object or an abstract concept. All objects have two basic characteristics: Objects have data, also known as state. For example, an object that represents a book has data such as the book’s title, author, and publisher. Objects also have behavior, which means that they can perform certain tasks. In Java, these tasks are called methods. For example, an object that represents a car might have methods such as start, stop, drive, or crash. Some methods simply allow you to access the object’s data. For example, a book object might have a getTitle method that tells you the book’s title. Classes are closely related to objects. A class is the program code you write to create objects. The class describes the data and methods that define the object’s state and behavior. Then, when the program executes, classes are used to create objects. For example, suppose you’re writing a payroll program. This program needs objects to represent the company’s employees. So, the program includes a class (probably named Employee) that defines the data and methods for each Employee object. Then, when your program runs, it uses this class to create an object for each of your company’s employees.
Practically speaking, Java is great because it allows you the developer to write code against one runtime that is mostly consistent between platforms (excluding the UI). It’s also easier to learn than C, which makes it perfect for CS and most corporate software. The Java naming conventions are relatively standardized, so it’s not a lot of work to use libraries etc. And it’s safe; even if you screw something up horribly in Java you won’t cause a machine-level compromise.
As they say, nothing better than BASIC and Pascal was invented. While you explain static functions about classes to a beginner, the desire to learn is greatly reduced, and then you wrote a couple of lines and you can already display something on the screen and calculate it - the most fan of the process. And if it works out, then there already choose which way to look.