void sample(){ }
nothing
string var()
{
return "hello";
}
hello
void sample( boolean isit){
}
isit - boolean
//call
float divide = div();
//definition
float divide(){
return 15/5;
}
no parameters
//call
rect(getX(15),200,50,60);
//definition
float getX(float a){
return a+100;
}
not an error
boolean isit(){}
boolean
//call
float c = divide(4.0,2.0);
//definintion
float divide(float a, float b){
return a/b;
}
2.0
void sample(){
}
no parameter
//call
sample(random(0,100));
//definition
void sample(float ran){
}
ran = decimal number between 0 and 100
boolean isit(float a);
Error
int sum( int a, int b){ }
int
void sample(){
println("hello");
}
Nothing
boolean isit(int a)
a - int
//call
print("total" + sum(10,15));
//definition
int sum( int a, int b){
return a+b;
}
a = 10 and b = 15
int sum( int a, int b){
return a+b,15;
}
float divide(float a, float b){ }
float
boolean isit(){
int a = 10;
if(a > 10)
return true;
if ( a<10);
return true;
return false;
}
false
float what (string word1){
}
word1 - string
//call
string is = sentence("hello", "world");
//definition
string sentence( string word1, string word2){
}
word1 = "hello" and word2 = "world"
float what (string word1){
return 4.5;
}
string line(string word1, string word2){ }
string
int sum (){
a = 5;
b = 5;
return a+b;
}
10
int sum( int a, int b){
}
a - int and b - int
//call
boolean is = isit(5);
//definition
boolean isit( int a){
}
a = 5
void sample(){
int c = 5;
return c;
}
Error!