Java Expressions : You may ask , what is expression mean ? Expression is a combination of variables,operators and methods calls that evaluates a single value.
Java Expressions Examples : String Expression Example
Action : assign value of string variable address to another string variable myaddress
Return Value: myaddress value ;
[code2]
String myaddress="asd";
String address ="rree";
myaddress=address;
[/code2]
Concatenate String
Action : concatenate the String code to the value of variable type
Return Value : the all string
java code
String type="rtrt";
type="code " + type;
Access a member
java code
int xArray[]= new int[5];
int length= xArray.length;
Action : get the number of elements in the array "myarray"
Return : integer represents the array size
Logical Expression
- Code:
x==y
Action : check if x equal y
Return : true or false