answersLogoWhite

0

class classname

{

public://access specifiers//

{

int a,b;//a and b are data members//

void get()

{

printf("\n mouni no");

scanf("%d",&a);

}

void display()

{

printf("mouni no is",&a);

}

};

here void functions are methods

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Can you declare a method within a method in c or c plus plus?

C: there are no methods in C. C++: no.


How do you write classes and objects for hospital management software using objective c or c plus plus?

You declare a class as follows: class MyClass { //some stuff here... } You create an object as follows: MyClass object; This is how you create classes and objects in C++.


In java why method defined in super class need not to defined in subclass?

In Java, or in any object oriented language such as C++, a method defined in super (parent) class does not need to be defined in a subclass, because that is the primary purpose of inheritance. Object oriented programming allows you to define and declare a class that implements the behavior for an object. Inheritance allows you to refine, or subclass, that class by "reusing" all of the functionality of the parent class into the sub class, adding additional definition and declaration for the sub class. If the subclass needs to change a parent class method, it can overload that method. This is called abstraction.


Difference between Method overloading and method overriding in C plus plus?

Yes. Any base class method that is declared virtual can be overridden by a derived class. Overriding a method that is not declared virtual can still be called, but will not be called polymorphically. That is, if you call the base class method, the base class method will execute, not the override. To call a non-virtual override you must call it explicitly.


What is a method in c plus plus?

In C++, methods are simply class member functions.


Is an abstract class virtual by default?

Unlike abstract class in C++, the abstract class in C# does not have any methods defined as virtual by default. The concept of virtual are not the same between C# and C++, either. Any virtual method must be defined explicitly in C#. Related to abstract methods - interestingly, an abstract class in C# does not have to have any abstract methods. However, the reverse, if a class need to have at least one abstract method, that class must be defined as abstract.


Can you make private class in c plus plus?

yes it is possible to make a private class in C++ but this class will not solve any purpose.................


What is virtual method invocation in java and net?

Virtual method invocation is a term borrowed from C++. It means that methods are invoked polymorphically. Instead of invoking the method in the compile-time type, the method is invoked as its runtime type. In C++, you declare methods virtual that are executed this way.


Sample code of typedefstruct in c plus plus?

You don't need a typedef to declare a struct in C++. A struct is declared exactly the same way that you would declare a class, the only difference being that struct members are public by default, while class members are private by default. Aside from that the class and struct keywords are completely interchangeable.


Open fopen create files. How to you create a folderdirectory?

In Visual C++, or C# you can use static method Directory or non-static DirectoryInfo.


How do you create a class in C plus plus?

class class_name { private: data_members; public: member_functions; };


What is member fusion in c plus plus?

If you are asking about member functions. When we declare a function inside a class then that function becomes member function of that class and this function can access the whole class