Java Tutorial

by Dinesh Thakur Category: Data Type

In the Following example LargestandSmallestnumber shows how to Find Largest and Smallest Number in an Array Using Java Example

 
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

This JavaFactorialUsingRecursion Example shows shows how to generate factorial of a given number using recursive function. Recursive are the function which calling method itself. the java recursion factorial example demonstrate recursive function call to find factorial. In mathematics, factorial is defined as n! = n*(n-1)...2*1. e.g. If we want to calculate factorial of 10 , then its factorial value is (10*9*8*7*6*5*4*3*2*1) = 3628800.



 
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

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

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

Variables are useful when you need to store information that can be changed as program runs. However, there may be certain situations in the program in which the value of variable should not be allowed to modify. This is accomplished using a special type of variable known as final variable. The final variable also called constant variable. It is a variable with a value that cannot be modified during the execution of the program.



 
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

This Java boolean Variable Example shows how to use Java boolean variable inside a java class. The boolean data type which can have only two values, true or false.



 

Page 8 of 80



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.