Processing supports below primitive data types.
a.
boolean
b.
char
c.
byte
d.
int
e.
long
f.
float
g.
double
How to define
variable
Syntax:
dataType
variableName = value;
Example:
int
intVariable = 10;
Here
dataType is int
variableName is intVariable
value
is 10
HelloWorld.pde
boolean status = true; char charVar = 'a'; byte b = 100; int i = 123; long l = 12345; float f = 123.45; double d = 123.45678; println("status = ", status); println("charVar = ", charVar); println("b = ", b); println("i = ", i); println("l = ", l); println("f = ", f); println("d = ", d);
When you ran the application, you can able to see below
messages in console window.
status = true charVar = a b = 100 i = 123 l = 12345 f = 123.45 d = 123.45677947998047
No comments:
Post a Comment