Forumchem - Forum with AI(ALICE BOT & HAL9000) and TTS

More dificult for us, more easy for you
It is currently Thu Mar 28, 2024 1:41 pm

All times are UTC





Post new topic Reply to topic  Page 1 of 1
 [ 4 posts ] 
Author Message
 Post subject: I had trouble with this object oriented test question? help
PostPosted: Thu Apr 03, 2014 1:09 am 
Offline
User avatar

Joined: Thu Oct 15, 2009 5:14 pm
Posts: 26
I had trouble with this object oriented test question? help please?

Suppose Dog is a derived class, derived from Animal. Given:
Animal a;
Dog b;

Which of the following results in a syntax error, and explain why?
a=b
b=a;


Top
 Profile      
 
 Post subject: Re: I had trouble with this object oriented test question? help
PostPosted: Tue Apr 08, 2014 8:10 am 
Offline

Joined: Tue Apr 08, 2014 8:09 am
Posts: 1
Cell phone jammer is an electronic device that blocks the transmission of signals between the cell phone and its nearby base station. By using the same frequency as the cell phones, the radio frequency blocker creates strong interference to the communication between the caller and the receiver. It is efficient in blocking the transmission of signals from the phone networks, including UMTS, 3G, CDMA, GSM and PHS.


Top
 Profile      
 
 Post subject: I had trouble with this object oriented test question? help
PostPosted: Fri Jul 07, 2017 7:26 am 
Offline
User avatar

Joined: Thu Apr 02, 2009 11:08 am
Posts: 1804
b=a is right because you add the (capacity) animal to the subject (dog)


Top
 Profile      
 
 Post subject: I had trouble with this object oriented test question? help
PostPosted: Sun Feb 14, 2021 6:32 am 
Offline
User avatar

Joined: Thu Apr 02, 2009 2:33 pm
Posts: 1330
b=a will give you a syntax error because you can not assign an Animal object to an identifier of type Dog without casting it to a Dog first. The reason for this i that the Animal object is not necessarily a Dog.



Top
 Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  Page 1 of 1
 [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: vawceix and 2 guests


 
Search for:
 
Jump to:  

cron
Click me:
Powered by phpBB © 2000, 2002, 2005, 2007, 2008, 2009 phpBB Group
Chronicles phpBB3 theme by Jakob Persson. Stone textures by Patty Herford.
With special thanks to RuneVillage

This site have 4 type of tecnology in order to convert text to speech. By default you use the vozme tecnology. In order to know the other you need to sign for.


- Privacy Policy -