It is possible to create a unnamed class? how make object of such class?

It is possible to create a unnamed class? how make object of such class?

What is unnamed class?
Basically, unnamed class is unlike from the regular class
-It do not have a name.
-Have not a concept of the constructor and destructor.
-we create a object of such type of class at the time of class declaration.

program:

#include < iostream>
using namespace std;
class
{
public:
int num=10;
int func()
{
cout<<"Unnamed class function";
}
}
object;
int main()
{
cout<< object.num<< endl;
cout<< object.func();
return 0;
}


output-

10
Unnamed class function




Read More →
Search
Categories
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!