Data types in Java
Skip to main content

Data types in Java

 

data types in java, data types in javascript, data types in java with example, data types in javascript with example, data types in java in hindi,primitive type data types in java, non primitive data types in java




Data types in Java:-

         This tutorial is explain about how many types Data Types in Java  explanation of Primitive type and Non Primitive type with example of Java Programming.

Data type divided into two groups:-

Primitive type:- Primitive data type is predefined in java. This is always contains a value and always star with lowercase. Size of primitive data depends on data types. Example:-byte,short,long,int,float, double,boolean and char

Non Primitive Type:- This data types is created by the programmer is not defined by JAVA. This is used to call a methods to perform a operations. This data types is declare as null type value. Non Primitive Type data types start with uppercase letter. Its size has same. Examples:- String , array and Classes.

Primitive Data Types:- A primitive data types is specified the size and types of variables.

Declaration:-

Integer Type:- This is store positive and negative values.

int mAge =1300000; //Integer data type store from -2147483648 to 2147483647

short mNum= 12000; // short data type store from -32768 to 32767

byte mByte=10; byte store data from -128 to 127

long mLong=1200000000L;


Most Read:-Introduction of Java


Floating Data Type:- When you need decimal type data then you use this two data types:-

float mPercent=10.5;

double mDouble=24.657d;


char mChar='A';

boolean mBoolean =true;



String mName="Gourav Kumar";

int mArray[]={1,2,3,4,5,6};


What is a class:- 

                          Class is a user defined prototype which individual objects are created. It is contains methodsconstructor etc. Body of class written between the curly braces.

Declaration of class:-

Class myClass{

             public static void main (string args[]){

             // Write your code hear.

  }

}


Install Java Instructions:-

Java installation instructions


Post a Comment

0 Comments