Java

72
2507 reads

February 7, 2013

Character Datatypes


In this example we see how we can declare basic character variable.
How we assign values in them and how we can increment them.

46
2428 reads

February 7, 2013

Compute Area of Circle


In this example we see, how to store floating-point variable.
'float'- 'float' specifies a single-orecision value that uses 32 bits of storage.

57
2474 reads

February 7, 2013

Compute distance light travels in given days using Integer Variables.


We need different types of integer variables to store different range of integer.
In this example we use int,short and long integer variable to store different integer.

215
3254 reads

February 7, 2013

NumberFormatException


Here, we ask user for a String specifically a int. Then we try to convert it. But if it fails, we catch the exception.

29
2347 reads

February 7, 2013

outOfBounds exception


Here we try to access an index of an array that is out of bounds. We show what happens.

27
2523 reads

February 7, 2013

Input to different type variable


It describes how to enter different data type in a simple syntax.

287
3728 reads

February 7, 2013

Static and Final variable


This example describes that how to access a class level variable without creating a reference object
and 'final' keyword by which we keep the value of a variable as constant.

56
2699 reads

February 7, 2013

Day of the Week


The program below demonstrates for a given date (gregorian calendar) the corresponding day of the week is printed out.

34
2427 reads

February 7, 2013

Class level and Function Level Variable


This example basically describes a way for data over-write of a class level variable and how to access value of that class level variable.

45
2311 reads

February 7, 2013

Bytes into a representation with metric units


The program below converts a number of bytes given as an int value such that the best metric unit is chosen for representation.