Child cObj = new Parent()
Wahts the output ?

Answer Posted / bhavin pandya

It will give yo Error :-
Object reference not set to an instance of an object.


If you want to create object then

Child cObj = new Child()
this is the right way

Is This Answer Correct ?    8 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where You Can Use Interface in your Project

1427


Why is static class not inherited?

599


given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy

2147


What is the difference between a constructor and a destructor?

613


What are the benefits of interface?

581






Templates mean

1589


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1458


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

1789


What is abstraction with example?

607


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

1944


What is polymorphism in oop example?

515


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1988


What is inheritance and how many types of inheritance?

622


Please send ford technologies placement paper 2 my mail id

1658


What is overloading and its types?

615