HI all I am new to C # and have picked up a copy of Sams teach yourself c # in 21 days. I hold a BSc in software design so I am not new to programming. However I am surprised at how similar c # is to java ( which i have studied for 2 years). I was just wondering if anyody could highlight the major differences for me so that I know what to look out for.
Many thanks in advance.

Recommended Answers

All 12 Replies

also if anyone can suggest a decent IDE (a free one) that would be greatly appreciated. Thanks.

There are major differences between java and C#
I give u some big differences
For example you can use only one public class in the same package in java context
in C# I can declare more than one public class at once in the same package
I can nest many namespaces(Packages in java context) in one name space, more than that I can declare two classes that hold the same name in the same namespace
ex:

namespace Firm
{
   namespace Finance
   {
       Public class Employee{TO DO: implement        the class} 

   }
namespace Logistics
   {
       Public class Employee{TO DO: implement        the class} 

   }

} 

In term of throwing exceptions for example
I can do this in C#

try{// CODE HERE}catch{}

something witch is not tolerated in java cath without any precision of what kind of (Exception e)
in the switch case statement for eg in C# I can use strings but in java we use only integers

switch (enumeration) 
{
    case “one”:
                  instruction 1;
    case “two”:
                  instruction 2;
    default: 
                  instruction 4;
                  break;
}

This framgment is not tolerated in java to do with java u must put 1 and 2 rather than "one" and "two"

there are many other major differences I u have MSDN insatalled browse to How do I and How Do I in C# -> .NET Framework -> Introduction to the C# and the .Net framework I advice u to read this article

u can download the Visual C# express edition there are 2005 and 2008 versions u can find them in the microsoft web site
Or u can use the sharpDevelp 2.0 IDE both are free

sorry SharpDevelop 2.0 istead of IDE harpDevelp

ok Jugortha Thanks for your advice am currently downloading V c#. had used sharp develop before but I didnt love it to be honest! cheers!!

ok Using the VS.Net IDE exposes you to many classes and libraries which are are common to all langauges. Download VS.Net 2005, it will provide extensible IDE for you. Thanks

ok thanks all for your suggestions

The C# language itself is not going to be the problem. It is a pretty useful language overall. Your big problems will come from the .NET libraries which make everything work.

I've been using C# for a over year now and still have major problems finding out how to do things which were obvious in other systems. And, I have 30 years of programming experience, so I know what needs to get done. .NET manages to be unnecessarily complex and unreasonably inflexible all at the same time. There are usually solutions to the problems you will face, but they aren't always easy to find. Forums like this one are often more help than the documentation.

Good luck!

thanks for your advice fishsqzr, will keep in mind

Java supports multiple inheritance but C# does n't support. C# only supports Multiple interface.

ok thanks all

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.