Re: Need some help please
From: George Birbilis [MVP J#] [9880] (birbilis_at_kagi.com)
Date: 02/12/05
- Previous message: Chris Jones: "Re: finishing of an application"
- In reply to: noir: "Need some help please"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 12 Feb 2005 22:42:05 +0200
> 1. convert between data types
//convert integer to string
int x=0;
String s=String.valueOf(x);
> 2. use an array
//init an array with numbers 0-9
int a[10];
for(int i=0;i<10;i++) {
a[i]=i;
}
> 3. use a vector
//create a Vector and add integer values 0 and 1 to it (as instances of
Integer class)
java.util.Vector v=new java.util.Vector();
v.add(new Integer(0));
v.add(new Integer(1));
> 4. use a loop
see case [2] above
> 5. use branching statement
int x=1;
if (x!=0) {
System.out.println("value is "+x);
//if the above line doesn't compile try "value is "+String.valueOf(x)
instead
} else {
System.out.prinltn("value is zero");
}
to make all these into a program do something like
public static void main(String[] args){
//...put your code here, using "System.out.prinltn(...)" wherever you need
to print out messages/values
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <birbilis@kagi.com>
Microsoft MVP J# for 2004, 2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime controls (Delphi & ActiveX: VB, PowerPoint, .NET)
+ Plugs (InterProcess/Internet communication)
+ TranXform (VB6 form to ASP.net WebForm convertion)
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
........................................................................
- Previous message: Chris Jones: "Re: finishing of an application"
- In reply to: noir: "Need some help please"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|