0
What is class in simple way, can anybody explain me please
9 Answers
+ 4
"Objects are created using classes, which are actually the focal point of OOP.
The class describes what the object will be, but is separate from the object itself.
In other words, a class can be described as an object's blueprint, description, or definition.
You can use the same class as a blueprint for creating multiple different objects..."
Source:
https://www.sololearn.com/learn/CPlusPlus/1710/?ref=app
Don't forget to check the comments section for creative answers.
+ 2
Raj Singhal
Creates a new object ("test") of type BankAccount(yes classes are called types sometimes). Then uses dot notation to call its public method.
Remember to open a new question next time.
AYUSH.ks It's ok. It's better to master one than just knowing the basics of many.
+ 2
We use " class " to create user defined data types that hold data according to our requirement's.
Example:- int x; Here 'x' is an integer variable that hold integer values ( like -7,-2,-9,0,3,1 ........etc)
Similarly
class country{
String name;
int Population;
string getName( return name )
}
Country c1; Here Country is an user defined data typed "c1" is an object of Country that holds " name and population"
+ 1
Sorry bro I can't. I use to study python and java in detail. you may contact with any another person who is good enough to explain you c++
0
Thanks bro...
Can you explain this code
#include <iostream>
using namespace std;
class BankAccount {
public:
void sayHi() {
cout << "Hi" << endl;
}
};
int main()
{
BankAccount test;
test.sayHi();
}
0
The part after int main
0
Ok
0
đ€đ