Similar Posts

Subscribe
Notify of
2 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
jo135
1 year ago

Can I compare classes in Java with structs from C?

Very limited. C-Structs and classes have in common that they can contain several data fields.

If what else can I compare with C, e.g. methods?

Since C does not know classes or objects, there are no methods. But of course it has freestanding functions. Java does not know such; Static methods are most likely to be comparable.

orochi02
1 year ago

compare. is of course not the same. if you store a function pointer in a struct you can simulate objects (more precisely, objects with methodologies)