Data Types Variables and Arrays
Data Types Variables and Arrays
class Cmdline
{
public static void main(String args[])
{
int count,i=0;
String s1;
count=args.length;
System.out.println(“No.of Arg=“+count);
while(i<count)
{
S1=args[i];
i=i+1;
System.out.println(i+ “=:”+s1);
}
}
}
Chapter -3
By:A.J.Patankar
Data Types
Data Types
Primitive Non-Primitive
Classes Arrays
Interface
char
boolean
int float
Variables
A variable is a named memory location
that can hold a value.
Format to declare variable. type varName
Example:
int i=260;
byte b=(byte) i;
double d= 1071.89;
byte db= (byte) d;