Inheritance


 
Thread Tools Search this Thread
Top Forums Programming Inheritance
# 1  
Old 05-11-2012
Inheritance

whats the use of inheriting with access specifier as private..?

Please specify the answer with a simple example...

Regards
-- Madhu
# 2  
Old 05-11-2012
Please read How To Ask Questions The Smart Way.

Please read the forum rules:
Code:
(6) Do not post classroom or homework problems in the main forums.
Homework and coursework questions can only be posted in this forum 
under special homework rules.

# 3  
Old 05-11-2012
I read the rules to post the question

This is not a home work question. I faced it in one of the discussion at my organization level...
# 4  
Old 05-11-2012
... OK. Please be more specific regarding the scope: which language?
# 5  
Old 05-14-2012
Here is the language.

It is related to C++ language.
# 6  
Old 06-12-2012
What ever you inherit, that goes to private section in the derived class.The code is accessible only to public members of the class.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

What is wrong with below python inheritance code?

I am using python 3.4. Below is the exception I am getting- Traceback (most recent call last): File "./oop.py", line 20, in <module> y = DerivedClass("Manu") File "./oop.py", line 15, in __init__ super().__init__(self,value) TypeError: __init__() takes 2 positional arguments but... (2 Replies)
Discussion started by: Tanu
2 Replies

2. Red Hat

Ulimit Inheritance

Hi , If i start mysqld or httpd as root user which inturn starts them as "mysql" or "apache" user, will the ulimit of "root" user or ulimit of "mysql/apache" user be set for the mysql/apache processes. My understanding is that the ulimit of the user who initiates the process(root in this... (2 Replies)
Discussion started by: Hari_Ganesh
2 Replies

3. Programming

Difference in multiple inheritance and multilevel inheritance: same method name ambiguity problem

Hi, In multi-level inheritance: class A { public: void fun() { cout << "A" << endl; } }; class B : public A { public: void fun() { cout << "A" << endl; } }; class C : public B { }; int main() { C c; c.fun(); // Ans: A } (1 Reply)
Discussion started by: royalibrahim
1 Replies

4. Shell Programming and Scripting

Inheritance in Perl

package Inventory_item; sub new { my($class) = shift; bless { "PART_NUM" => undef, "QTY_ON_HAND" => undef }, $class; } package main; $item = Inventory_item->new(); Can any one please help me in brief explaining the line... (5 Replies)
Discussion started by: parthmittal2007
5 Replies

5. Programming

C++ Inheritance problem??????

Hi friends, I hope u people are ok and doing fine. I have this small problem with the derived class. I have created te base class and there is a small problem with the definition of the derived class which the compiler is pointing out, could you please help me. Here is my code #ifndef... (2 Replies)
Discussion started by: gabam
2 Replies

6. AIX

WLM inheritance

Is none of you using WLM? A search gives no matches.... Anyway, I have set up a class with inheritance = yes. In the rules characteristics I have chosen a shell script as an application. This script is caught by the class, but not the child processes, which have the PID of the script as the... (6 Replies)
Discussion started by: firefox111
6 Replies

7. UNIX for Dummies Questions & Answers

Question on variable inheritance & code statements

1) I have the below code in concattxnrecords.sh shell script and it is calling the genericVars.sh shell script which is mentioned as below has some code inside it which would intialize some variables in it, now my question is will this shell script would inherit those variable definitions or not... (3 Replies)
Discussion started by: Ariean
3 Replies

8. Shell Programming and Scripting

Makefile: Parent - Child Inheritance and export

Hi, I have a number of Makefiles, including a couple of files that I include in Makefiles, a few scripts that are executed through Makefiles, and I have problems with environment variables that are not inherited to the scripts properly. Simplified scenario: rootdir/Makefile: all: ... (1 Reply)
Discussion started by: Shompis
1 Replies

9. Shell Programming and Scripting

perl - variable inheritance

Hey Everyone, Does anyone know how - or if it's even possible - for a child perl script to inherit the variables of a parent perl script? In a shell script, you would use "export" for example. I am running Perl 5.8. Basically, let's say "perl1.pl" calls "perl2.pl" and I want "perl2.pl" to... (2 Replies)
Discussion started by: gsatch
2 Replies
Login or Register to Ask a Question