Can we call methods in java as functions in c++??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Can we call methods in java as functions in c++???

28th May 2018, 8:20 AM
sakshi patidar
sakshi patidar - avatar
4 Answers
+ 9
So far I've observed a similarity in the syntax of function calls in C++ to calling static methods in Java, because I can call functions without using the dot notation. This is not to be confused with the meanings of concepts like static etc. I haven't reached OOP concepts in C++ yet, so I'm not sure how things will change when objects are introduced. Generally if you've used functions in either C++ or Java, then you'll be comfortable using them in the other.
28th May 2018, 11:19 AM
G.T.T
G.T.T - avatar
+ 8
functions in java are methods as there inside a class
28th May 2018, 8:23 AM
D_Stark
D_Stark - avatar
+ 3
oky....thnxx
28th May 2018, 8:27 AM
sakshi patidar
sakshi patidar - avatar
+ 3
When you make class in c++ and make functions(methods) in this class you need to use dot operator or arrow operator if you use pointer to object.
28th May 2018, 7:58 PM
Pawel Bolek
Pawel Bolek - avatar