You are here:   HomeJava Programming
by Dinesh Thakur Category: Data Type

Operators work on the same data type. However, Java has wide variety of data types from which we can choose the suitable for a particular purpose. To perform the operation on variables from two different types of data we have to convert Both types to the same .



 
by Dinesh Thakur Category: Data Type

Type casting is the process of "casting"(Casting mean ‘conversion’ of value to another type) of value to one type to another type of variable.

 
by Dinesh Thakur Category: Data Type

In the Following example PerimeterofCircleExample shows how to Calculate Perimeter of Circle using 2*pi*r. where r is a radius of a circle.

 
by Dinesh Thakur Category: Data Type

Java's built-in data types called primitive data types. The primitive data types are int, byte, short, long, float, double, char, and boolean. A variable of any of these data types is called a primitive variable. We explain primitive data types in more detail as follows:



 
by Dinesh Thakur Category: Data Type

Sometimes you have to work with characters that are not listed on the keyboard or with characters that have a special meaning, as symbol as a "newline." They can not be displayed directly in the source the program code, and to use them we need special techniques that will look at now.

 
by Dinesh Thakur Category: Data Type

In Volume of a Sphere in Java Example , Math.PI is used because it denotes the value of pi i.e. 3.1414. Math.pow(r,3.0) is used for computing y3



 
by Dinesh Thakur Category: Data Type

In the Following example AreaofCircleExample shows how to Calculate Area of Circle using pi*r*r. where r is a radius of a circle.

 
by Dinesh Thakur Category: Data Type

step 1: Read a character

step 2: Cast it into byte and store in b

step 3: Print b

step 4: Exit

 
by Dinesh Thakur Category: Data Type

This Convert int to string java example shows how to convert int to String in Java.



 
by Dinesh Thakur Category: Data Type

This Reverse Number using Java program prints reverse number using numeric operations i.e. if the input is 564 then output will be 465. we can see after reversing the integer is print the integer digits in reverse order.



 

Page 8 of 80

What's New and Popular