Basic Data Types in Java Programming – Example Code

In previous post we learned how to write a very simple hello world Java program. In this simple program we will explain what are some different data types in Java. We use specific data types to define variable depending upon the nature of data we want to store in variable. [js] public class DataTypesJava { public static void main(String[] args) { //single line comment boolean isBoolean = true; // boolean data type store either true or false int isInt = 120; // int data type is used to store integer values int mult = isInt * 2; // multiplication is...
forward

Hello World Program in Java

In this post we will discuss and explain how to write a simple hello world program in java. To write, compile and execute a java program many IDE's are available but we will use netbeans  (www.netbeans.org). Following is the simple hello world program in java programming. Step 1: Open netbeans IDE, go into File and click New Project. A new box will appear. From categories select Java and from projects select Java Application and click Next. Step 2: Define project name and project location and make sure that Create Main Class checkbox is checked then click Finish. Step 3: All...
forward