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

oop concepts like inheritance, polymorphism,abstraction and encapsulat

Page 1 of 1

9 Replies - 6594 Views - Last Post: 17 August 2010 - 08:54 AM

#1 jameskyle123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 13-October 09

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

Posted 09 August 2010 - 10:04 AM

hi ,
sorry i cant find an appropriate thread for my post. ^^

i keep finding on the internet on how do Java differ in 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

Is This A Good Question/Topic? 0
  • +

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

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1633
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

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.
Was This Post Helpful? 2
  • +
  • -

#3 Raynes  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 610
  • View blog
  • Posts: 2,815
  • Joined: 05-January 09

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.
Was This Post Helpful? 2
  • +
  • -

#4 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5643
  • View blog
  • Posts: 12,359
  • Joined: 16-October 07

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.
Was This Post Helpful? 2
  • +
  • -

#5 Tom9729  Icon User is offline

  • Segmentation fault
  • member icon

Reputation: 180
  • View blog
  • Posts: 2,641
  • Joined: 30-December 07

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

Posted 10 August 2010 - 11:42 AM

This smells like a homework question.
Was This Post Helpful? 0
  • +
  • -

#6 Vestah  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 21
  • View blog
  • Posts: 86
  • Joined: 15-October 09

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?

*ignores the better-language discussion*
Was This Post Helpful? 0
  • +
  • -

#7 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10185
  • View blog
  • Posts: 37,603
  • Joined: 27-December 08

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

Posted 13 August 2010 - 09:26 AM

Moved to the Corner Cubicle.
Was This Post Helpful? 0
  • +
  • -

#8 NeoTifa  Icon User is offline

  • Whorediot
  • member icon





Reputation: 2497
  • View blog
  • Posts: 15,460
  • Joined: 24-September 08

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.
Was This Post Helpful? 1
  • +
  • -

#9 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5643
  • View blog
  • Posts: 12,359
  • Joined: 16-October 07

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

Posted 13 August 2010 - 11:13 AM

*
POPULAR

View PostVestah, 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.

The other, a biggie, is delegates. Java's event model relies on observer patterns and interfaces. C# uses an explicit event property powered by method reference. It's a far more elegant solution.

Keep in mind, C# came out five years after Java; it started out as Java with the benefit of hindsight.
Was This Post Helpful? 7
  • +
  • -

#10 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 781
  • View blog
  • Posts: 7,604
  • Joined: 05-May 05

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

Posted 17 August 2010 - 08:54 AM

View Postjameskyle123, on 09 August 2010 - 10:04 AM, said:

hi ,
sorry i cant find an appropriate thread for my post. ^^

i keep finding on the internet on how do Java differ in 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.

This post has been edited by WolfCoder: 17 August 2010 - 08:56 AM

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1