473,385 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Test Question

1
In Case Of Runtime Polymorphism______________

A. Late Binding Is Taking Place At Run Time
B. Late Binding Is Taking Place At Compile Time
C. Compiler Doesnt Know How To Respond
D. None Of The Above

Does Anyone Know The Answer To This Question And Why?
Apr 3 '07 #1
1 1185
JosAH
11,448 Expert 8TB
In Case Of Runtime Polymorphism______________

A. Late Binding Is Taking Place At Run Time
B. Late Binding Is Taking Place At Compile Time
C. Compiler Doesnt Know How To Respond
D. None Of The Above

Does Anyone Know The Answer To This Question And Why?
Think of the following little scenario:
Expand|Select|Wrap|Line Numbers
  1. abstract class B { abstract void foo(); }
  2. class D1 extends B { void foo() { System.out.println("D1"); } }
  3. class D2 extends B { void foo() { System.out.println("D2"); } }
  4.  
  5. class Test {
  6.    public static void main(String[] args) {
  7.       B d1= new D1();
  8.       B d2= new D2();
  9.       d1.foo();
  10.       d2.foo();
  11.    }
  12. }
Now check the four possible answers and see what the compiler can
possibly know about the foo() calls.

kind regards,

Jos
Apr 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Weekend | last post by:
Currently, i want to develope a multiple choice exam website. The content of the test is store in an XML file. I want to carry out some function. Could you tell me which programming language should...
7
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
9
by: Hudson Reis | last post by:
Hi all, Test, please ignore. Hudson
2
by: UnixUser | last post by:
I need to know what the table is for a crc32 with a Polynomial of 0X04c11db7? Is there a way to prove the result. In other words given the test "the cat and dog ran down the street" what is the...
9
by: Deckarep | last post by:
Hello Group, I actually have two seperate questions regarding Unit Testing with NUnit in C#. Please keep in mind that I'm new to the concept of Unit Testing and just barely coming around to...
176
by: nw | last post by:
Hi, I previously asked for suggestions on teaching testing in C++. Based on some of the replies I received I decided that best way to proceed would be to teach the students how they might write...
60
by: marss | last post by:
Maybe anyone know good free online JavaScript knowledge test? This not exactly a system for testing online required - it may be simply list of questions with variants of answers (I have to prepare...
2
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
4
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer...
16
by: Heinrich Pumpernickel | last post by:
i got the following strange extra question in a written test today . since the test was abt c/c++ i guess this is on topic here --8<-- 22) Consider the following quote: "If Mickey's a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.