Home Log In or Register Forums

C# course

Home > Forums > It And Computing > 'C# course'
'C# course'
Page: [1] [2]
richard's user image
richard
29.06.2004 - 10:27
forum administrator
Hello all,

Well I'm on day #2 of the C#/Java course! I call it C#/Java because up to now, I have found precisely zero differences between the two languages. Aside from the obligatory different library names.

Labs are so ridiculously easy that it's not even fun! :/

I'm sure it'll pick up before long... We're going to a Thai restaurant for lunch today :o)

Rich
richard's user image
richard
29.06.2004 - 17:14
forum administrator
Major difference #1:

A multi-dimensional array is declared like this in C#:

int[x,y];

Rather than the Java way:

int[x][y];

Quite a major difference, huh?
arar's user image
arar
29.06.2004 - 21:26
Whoa, cool? Any other syntactical differences?

(Attempt to make myself sound clever : Failed)
deathjester's user image
deathjester
29.06.2004 - 23:30
forum administrator
indexers.
come back knowing all things about indexers, CollectionBase, DictionaryBase and collections in general pls :)

see if u can sniff out the reason for having 'try catch finally' over 'try catch' too. foxes me.

this is irritatign me too:

-------------------------------------------------------------------------------------------

Strangely, I can't:

..using System.Windows.Forms..

when writing a "class". How is the IDE differentiating my class between that of a class which happens to be a form?

For example, I can't use System.Windows.Forms.MessageBox.show() from within my "class" class, but I can from within a "form" class.

Does the project file keep secret tabs/hidden code against our own code? I know Visual Studio in the past (esp VB6) had lots of 'features' like this.

-------------------------------------------------



have fun :)
richard's user image
richard
30.06.2004 - 10:37
forum administrator
try/catch/finally: the easy explanation

try something
catch error
finally do something else

The important point is that finally ALWAYS gets executed (useful for cleaning up objects, for example). BUT, this is only useful if you don't catch every error. If something other than what you're expecting occurs that you didn't catch, code after the try/catch block wouldn't normally get executed, but with a finally it would.

Hope that makes sense. Very hungover from last night!
deathjester's user image
deathjester
01.07.2004 - 00:04
forum administrator
ahhhhh, finally{} goes off irrespective of catch(){}.

course it does. ok why didnt i...

>sepuku<
richard's user image
richard
01.07.2004 - 08:50
forum administrator
That's a little harsh, no need to kill yourself :)
richard's user image
richard
01.07.2004 - 10:37
forum administrator
Polymorphism:

Ouch, this is one tough subject. It's quite a bit more complicated than Java, there's lots of keywords that you need to use, but once you work it out it's got one or two nifty things that Java doesn't

When you implement multiple interfaces in C#, you can have two or more methods with the same name. In the example we were given, you can have a Painter interface which has the Draw ability and a Cowboy interface which also has the Draw ability. The great thing is that you can have an ArtisticCowboy and he can do both things! This isn't possible in Java, you'd have to have different function names like DrawPicture and DrawGun.
nelson's user image
nelson
01.07.2004 - 20:36
forum administrator
I sometimes wonder what is the real usefulness of really convoluted capabilities like that. I mean, yes, it's cool, but can you see how much less obvious it makes the code?
nelson's user image
nelson
01.07.2004 - 22:12
forum administrator
This might be of interest, then... (just don't mention it too loud near the MS peeps).

;-)
Page: [1] [2]

You must log in to post messages on this board. If you don't have a username and password, you can register quickly to get them!

contact us © 2003, 2004 BurningHorizons.net