chuawenching
Regular
- Joined
- Jul 26, 2003
- Messages
- 66
I had 4 questions as i am trying to convert into c#.
In c#, it is slightly easy as drag and drop.
1) java.awt.Choice
imports java.awt.*;
Choice haha;
haha = new Choice();
haha.addItem(Float.toString((float) 0.05);
later,
Panel controlPanel = new Panel();
controlPanel.add(haha);
So what is Choice haha in c#?
2) I had a class that extends Canvas
class ACanvas extends Canvas
{
Image image;
Color color;
...
...
}
So how can i code Canvas in C#?
3) in C#, you can code class or struct. But in java, you only can code class.
So how do i know if i am converting a java code, which to struct and which to class?
4) ref value
I check some google website http://www.javacamp.org/javavscsharp/refparam.html
it states that in java code:
static void haha (int a, int b)
so in c#, i need to code this,
static void haha(ref int a, ref int b)
Can't i just code like java without ref keyword?
Thanks.
Regards,
Chua Wen Ching
In c#, it is slightly easy as drag and drop.
1) java.awt.Choice
imports java.awt.*;
Choice haha;
haha = new Choice();
haha.addItem(Float.toString((float) 0.05);
later,
Panel controlPanel = new Panel();
controlPanel.add(haha);
So what is Choice haha in c#?
2) I had a class that extends Canvas
class ACanvas extends Canvas
{
Image image;
Color color;
...
...
}
So how can i code Canvas in C#?
3) in C#, you can code class or struct. But in java, you only can code class.
So how do i know if i am converting a java code, which to struct and which to class?
4) ref value
I check some google website http://www.javacamp.org/javavscsharp/refparam.html
it states that in java code:
static void haha (int a, int b)
so in c#, i need to code this,
static void haha(ref int a, ref int b)
Can't i just code like java without ref keyword?
Thanks.
Regards,
Chua Wen Ching