Switch to full style
Java2 codes,problems ,discussions and solutions are here
Post a reply

java Expressions

Tue Jan 27, 2009 11:11 pm

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



Post a reply
  Related Posts  to : java Expressions
 Results of Java expressions for arithmetic operations     -  
 Regular Expressions and Patterns     -  
 String replace with Regular Expressions     -  
 2d game in java-Monster-Java 2D Game Graphics and Animation     -  
 What is Java API?!!!     -  
 java or .net     -  
 need help in java     -  
 Using FTP in java     -  
 what is java     -  
 Java course     -  

Topic Tags

Java Basics