Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Overridden members system verilog classes

Status
Not open for further replies.

jdshah

Junior Member level 3
Joined
Dec 17, 2010
Messages
28
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Ahmedabad
Activity points
1,481
I have below query.
class my_a;
int member1 = 1;
endclass
class my_ea extends my_a;
int member1 = 2;
endclass

Now when I do
my_a A;
my_ea EA;
EA =new();
A=EA;
============================================================
EA = new(); has given handle to object of type my_ea to class variable EA.
A=EA; This pass the same handle (pointer value which points to object of my_ea) to A.
so , A.member1 should refer to value 2.

But it refer to value 1. why?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top