Replies To: what is the difference in OOP concepts between java and c#?

Re: what is the difference in OOP concepts between java and c#?

Posted 09 August 2010 - 10:35 AM

Not yet another Which language is better thread?!?!

It's simple, there is no better language, they all have their pros/cons and uses. Java is not better than C# and C# is not better than Java (good God that was hard to say lol). OO concepts are pretty much the same across all OO languages, it's just the path to get to the final destination is normally different in each language.

Re: what is the difference in OOP concepts between java and c#?

Posted 09 August 2010 - 08:26 PM

OOP is OOP. The concepts remain the same. Java and C# appear to offer OOP in pretty much the same flavor. I'd say this is the last thing you should be worrying about in a comparison between the languages.

If you ever want to see what OOP looks like outside of languages like C# and Java, check out something like Factor or Smalltalk. Your mind will be blown.

Re: what is the difference in OOP concepts between java and c#?

Posted 10 August 2010 - 04:13 AM

No fundamental difference. C# started life as a near identical clone of Java, perhaps with enough differences to not get sued. While they have different constructs, for the basic OO stuff they are the same.

There is no better, just what meets your requirements. If you were planning to write exclusively for Windows, C# would be the better choice. If not for Windows or cross platform, Java would be the only choice.

Re: what is the difference in OOP concepts between java and c#?

Re: what is the difference in OOP concepts between java and c#?

Posted 12 August 2010 - 04:25 AM

I am quite interested in this as I am going from Java to C#.
Neither support multiple inheritance, but C# allows partial classes. It allows the definition of a class to be split into multiple units if I understand it correctly. A concept not present in Java.
Are there other such conceptual differences?

Re: what is the difference in OOP concepts between java and c#?

Re: what is the difference in OOP concepts between java and c#?

Posted 13 August 2010 - 10:30 AM

OOP is just a concept or practice. C# and Java are just tools for executing that concept. Take drilling for example: the concept of creating a hole in a surface with threads inside to put screws in, yet would you use a drill or a tap? The concept of drilling is the same, just the tools are different. It really depends on the other specifications and the context in which this is being put into use (i.e. if it's cement, you're better off with a tap, yet if it's just drywall, a drill would suffice). They both drill and create threads.

Re: what is the difference in OOP concepts between java and c#?

Posted 13 August 2010 - 11:13 AM

POPULAR

Vestah, on 12 August 2010 - 05:25 AM, said:

Are there other such conceptual differences?

There are two thing C#, as language structures, that Java will unlikely ever have. In Java, the getter/setter convention is very common, but the concept isn't really formal. In C#, properties take that idea of make is clear. More, a property, basically a wrapped getter/setter, behaves like a variable to calls. If someone gives you a crappy class with exposed variables, you can implement them as properties and not break anything.

Re: what is the difference in OOP concepts between java and c#?

1. in terms of inheritance
2 in terms of abstraction
3. in terms of encapsulation
4. in terms of polymorphism

i also want to know which is better between them

WRUUUUUUUUUH! Will people stop comparing C# and JAVA?

Anyway, I can do all this stuff in C. The question is how can these be implemented in the language and what features you would use to do this. It's been the general sense that both C# and JAVA implement features to help you with OOP, so just pick whatever feels better.

I personally don't use java for the OOP, I use it for times when I need speed development with performance not being an issue. It's also great for modeling.