what is object slice?

Answers were Sorted based on User's Feedback



what is object slice?..

Answer / vivek

When a derived class object is assigned to a base class,
only the base class's part of content in the derived object
are copied to the base class, leaving behind the derived
class specific contents. This is referred as Object Slicing.

Is This Answer Correct ?    12 Yes 0 No

what is object slice?..

Answer / rajashekar reddy peta

Object slicing is defined as the conversion of an object into something with less information (typically a superclass).

Is This Answer Correct ?    5 Yes 2 No

Post New Answer

More Core Java Interview Questions

How many ways can an argument be passed to a subroutine?

3 Answers   Technological University of the Philippines,


java Technical questions asked by JPMC

0 Answers   JPMorgan Chase,


when asub class inherits a super class and overrides a public method of super class in sub class(public method in super class). why these methods needs to be public in sub class. (otherwise compile time error).

3 Answers  


What do you understand by abstract classes?

0 Answers   HCL,


Why does java does not support multiple inheritance? Explain

0 Answers  


Explain the protected field modifier?

0 Answers  


Sample code to retrieve objects from HashMap in sorted ascending order?

2 Answers  


describe method overloading

0 Answers  


Can we have two methods in a class with the same name?

0 Answers  


What is local variable and instance variable?

0 Answers  


What is loop in java?

0 Answers  


What is the access scope of protected access specifier?

0 Answers  


Categories