0

Why is class not compulsory in c++?

in java class making was compulsory but its not so on c++. has this got anything to do with c++ being pop and java oop?

3rd Jul 2017, 5:29 PM
Pramit@10
Pramit@10 - avatar
2 odpowiedzi
+ 4
hi, c++ is partially object oriented programming so we can write program without classes and object. Incase of java which is fully object oriented programming so we can't write program without classes and object.
3rd Jul 2017, 5:31 PM
Nanda Balakrishnan
0
Because C++ is not fully object oriented, its is partially. Classes are used to define a set of functions all together and all the properties of class are shared by its member functions. if u do not create a class, u will have t create a funntion again and again and call it repeatedly in the main() function.
3rd Jul 2017, 6:17 PM
Abhishek Kansal
Abhishek Kansal - avatar