Add



Java Language Basics

You have definitely heard about a lot of languages in your life like English, French, German, and Urdu etc. these are all natural languages. But if you observe then you will find out another category of languages like Java, C++, Visual Basic, Visual C++, and VB.Net etc. these all lie in computer language class.




Why Do We Need Computer Language?

Before answering this question, I would like to ask a question from you "Why do we need Natural Language?" Definitely your answer would be “to communicate some person.” Similarly to communicate with computer we require computer language.

Types of Computer Language

There are mainly two types of computer language i.e. High Level Language, and Low Level Language.
The text written in High-level language is in human readable form means near to natural language e.g. English language while the text of Low-level language is in machine-readable form means in the form of 0s and 1s. Note that there is also a third category of computer language i.e. Middle-level language e.g. C++ but for the time being keep in mind only above two categories.

Is Java A High Level Language?

Yes, Java is a High-level language. Programmers write their programs in high-level language.

Does Computer Understand High-level Language?

No, it does not directly understand. Basically when software developers write program in high-level language then they have to convert it to low-level language by using some language translator.

What Are The Types of Language Translator?

There are compilers and interpreters which are actually types of the language translator.
Difference in these translators is that compiler translates whole code at a time and makes a separate executable file while interpreter translates line by line and does not generate any exe file. Either compiler will be used or interpreter, it all depends on the language. For example, C++ uses compiler while Visual Basic uses interpreter.

Which Translator Is Used For Java?

Hmmm, as for as Java is concerned both compiler and interpreter are used. First Java file is compiled and as an output a new separate file is created i.e. class file. Now this class file is being interpreted using JVM (Java Virtual Machine). Its complete scenario would be discussed in next lesson.

Which Are Editors To Write Java Code?

There are many text editors available where you can write Java Code. For example TextPad, JBuilder, eclipse etc. TextPad is a text editor with simple functionality like options for compile, run etc. while JBuilder has more advance functionalities than TextPad. In fact you can also use NotePad as your editor. Note that you can freely and easily download TextPad and eclipse from their website.

Extension for Java File

Every file has its own extension e.g. MSWord file has the extension “.doc”. While C++ file extension is “.cpp”. Similarly when you are to save your Java code then use the extension “.java” for it e.g. “Omer_Class.java”.

Java File Name

The name of Java File must be exactly same as the class name in which main(String arg[]) method is declared i.e. if the class name is Omer_Class then the java file name should be “Omer_Class.java”.

Platform Independence

Java provides platform independence which means that once you create the “.class” file, now it can be run on any operating system by using Java Virtual Machine (JVM). Actually when you compile the “.java” file then a new file is created i.e. “.class” file and this .class file contains byte code which is in fact platform independent.

Is Java Object-Oriented?

Yes, Java is surely object-oriented. In it everything is considered as object. This makes this language very close to the real world objects. There are also some other factors that make a language object-oriented but at this level you don’t need to know them. Just keep in mind Everything is Object in Java.

From Where To Download Java Development Kit (JDK)?

Java is the product of Sun Microsystems and it was developed in 1991. From 1995 it became very famous for the web. You can download it from java.sun.com.

How To Install Java Environment?

When you will download the JDK then there would be a single “.exe”. Just double click it and then it will guide you properly what to do next. Finally it would be installed on your PC.