Operators And Expressions In Java – 1

Operator : An operator is a symbol that performs some kind of operation on one, two or three operands and produces a result. The type of the operator and operand determines which operation would be performed and type of the result produced.

Operand : An operand is a data item on which the operators perform its operation.

Expression : Expression is a valid combination of operators and operands that evaluates to a value.

Continue reading

Data Types And Variables In Java

A data type is defined in terms of three components:

  • Set of values
  • Set of operations that can be applied
  • Storage of values in memory

A data type that is defined by the language itself and consists of an atomic and indivisible value is known as a primitive data type. User-defined data types are defined in terms of primitive data types and other user-defined data types. Continue reading

Compiling And Running Our First Hello World Program

In this post, we are going to write our first java program that will just output Hello World to terminal. I assume that you have installed JDK and setup the PATH environment variable appropriately. If not then read the first post for installing and setting the PATH variable.

Java is an object oriented programming language i.e. everything should be inside a class. So, we will define our first class HelloWorld. Continue reading

Setting Up The Environment For Developing Java Programs

For developing the java programs, we only need JDK (java development kit). JDK is used for compiling the java programs to binary programs consisting of byte codes. Byte codes are the machine instructions for JVM (Java Virtual Machine). When you execute a Java program, a program called the Java interpreter inspects and deciphers the byte codes for it, checks it out to ensure that it has not been tampered with and is safe to execute, and then executes the actions that the bytecodes specify within the JVM. Continue reading