what is object slice?
Answers were Sorted based on User's Feedback
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 |
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 |
What is the difference between Error, defect,fault, failure and mistake?
what are depricated methods in threads and explain the lifecycle methods
Does a function need a return?
Can an exception be rethrown?
What access modifiers can be used for variables?
Why we used vector class?
What is Java exception handling?
we have two threads..both the threads are reading the data.. is there any need of synchronization there?...justify it?
What is null mean in java?
What are access specifiers available in java?
11. static class A { 12. void process() throws Exception { throw new Exception(); } 13. } 14. static class B extends A { 15. void process() { System.out.println(”B”); } 16. } 17. public static void main(String[] args) { 18. new B().process(); 19. } What is the result? 1 B 2 The code runs with no output. 3 Compilation fails because of an error in line 12. 4 Compilation fails because of an error in line 15.
Can I learn java in 3 months?