Object in C# and Object in Java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Object in C# and Object in Java

I want to know if i this class is... similar in both lenguages. I mean, if theres a huge diference or is basically the same

21st Jan 2021, 12:20 AM
Diego Becerril
Diego Becerril - avatar
1 Answer
+ 1
Classes are the basic unit of code and nothing exists outside of them Java will manage memory for you via Garbage Collection Java will allow you to write code that can be run anywhere, sidestepping the portability issues via the JVM Java will get rid of problematic multiple inheritance, and instead provide Interfaces for mixing in multiple types of behavior in a single class (This is a major win if used correctly) Java will always do polymorphic calls. Slightly controversial, but easier to understand and use than C++'s behavior All objects will be descendants of a common class (Object), allowing better generic code Boxing/unboxing will be used to take care of primitive types You always deal with references to objects, rather than pointers to memory or actual values Check here also https://www.studytonight.com/cpp/introduction-to-cpp.php
21st Jan 2021, 3:32 AM
Sagar Maurya
Sagar Maurya - avatar