how much classes are used in c++
Answers were Sorted based on User's Feedback
We can use more classes these are userdefined and builtin
classes
Is This Answer Correct ? | 17 Yes | 1 No |
Answer / saurabh
We can use as many classes as we want in our program..
By the way AMIT, main() is a function and not a class
Is This Answer Correct ? | 9 Yes | 1 No |
Answer / preeti goyal
In each program main is a function. but main is also hold
by a class so atleast one class is necessary.
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / amit
WE CAN DEFINE AS MANY CLASSES AS WE WANT.THERE IS NO
RESTRICATION.BUT THERE IS ATLEST ONE CLASS i.e. main()
Is This Answer Correct ? | 8 Yes | 14 No |
what is SPL in c++.
what is difference between c++ language and java language
In multilevel inheritance constructors will be executed from the .... class to ... class
#include <stdio.h> #include <alloc.h> #include <stdlib.h> #include <conio.h> void insert(struct btreenode **, int); void inorder(struct btreenode *); struct btreenode { struct btreenode *leftchild; struct btreenode *rightchild; int data; }; main() { struct btreenode *bt; bt=(struct btreenode *)NULL; int req,i=1,num; clrscr(); printf("Enter number of nodes"); scanf("%d",&req); while(i<=req) { printf("Enter element"); scanf("%d",&num); insert(&bt,num); i++; } inorder(bt); } void insert(struct btreenode **sr, int num) { if(*sr==NULL) { *sr=(struct btreenode *)malloc (sizeof(struct btreenode)); (*sr)->leftchild=(struct btreenode *)NULL; (*sr)->rightchild=(struct btreenode *)NULL; (*sr)->data=num; return; } else { if(num < (*sr)->data) insert(&(*sr)->leftchild,num); else insert(&(*sr)->rightchild,num); } return; } void inorder(struct btreenode *sr) { if(sr!=(struct btreenode *)NULL) { inorder(sr->leftchild); printf("\n %d",sr->data); inorder(sr->rightchild); } else return; } please Modify the given program and add two methods for post order and pre order traversals.
can you explain how to use JavaBean in Project
for example A,B,C,D are class all the 4 class contain one method who() but the method who() implementaion is differnet among each class. the relation among the 4 class are A is base class and is inherited by B and C.and from this two B and C where D is inherited. the question is i want to display the output who() method in all the classes(A,B,C,D)the output of who() method is diferrent amond all the class(A,B,C,D) ------A------ virtuval who(print a) override | | who(print b) B C override who(print c) | | -------D------ override who(print d)
What does and I oop mean?
Write a program to accept a number and to print numbers in pyramid format? for eg:for a no. 5 1 212 32123 4321234 543212345
What do you mean by variable?
What is multiple inheritance? Give Example
Can we create object of abstract class?
What is class encapsulation?