GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java
Go To First  |  Previous Question  |  Next Question 
 Core Java  |  Question 152 of 492    Print  
we know that Object class is super class of every class & a class extends only one class. so
how is it possible to a class to extend other than Object class?



Because java supports multilevel inheritance.


  
Total Answers and Comments: 2 Last Update: November 11, 2005     Asked by: tulasi 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 04, 2005 08:09:19   #1  
krishna prasad Member Since: November 2005   Contribution: 1    

RE: we know that Object class is super class of every...

case 1

suppose you have a class Test, which doesn't extend any other class. So by default, Object becomes it's super class.

                                   Object->Test

case 2

If your Test class wants to extend some other class, for example Hashtable, your class will become a sub class of Object through Hashtable because Hashtable is a subclass of Object. Any class you are trying to extend will be a subclass of Object directly or due to hierarchy. 

                                    Object->Map->Hashtable->Test

Object is the superclass of Test even when you have Test extend HahTable

So according to case 1 Test is a subclass of Object directly.

According to case 2 Test is a subclass of Object due to the hierarchy.

so no matter you extend a class or not, your class will always be a subclass of Object.


 
Is this answer useful? Yes | No
November 11, 2005 12:35:43   #2  
mandyjoshi Member Since: November 2005   Contribution: 20    

RE: we know that Object class is super class of every...
The half answer is explain by Krishna Prasad and Other half lies in answer of question why java does not support multiple inheritance. And how it has solved that problem using interfaces. 
 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : The intention behind this question is not clear here. Can u elaborate the question??????????? ...

Latest Answer : yes they are represented as wrapper classes ...

Latest Answer : A static member class or a static member interface comprises the same declarations as those allowed in an ordinary top-level class or interface. A static member class must be declared as a static member of an enclosing class or interface. Nested ...

If there are 2 different versions of object streams on disk and only one object definition, how will the JVM reject the wrong one? Can you fool the JVM

When you have an object passed to a method and when the object is reassigned to a different one, then is the original reference lost

Can we declare multiple main() methods in multiple classes.ie can we have each main method in its class in our program?

Latest Answer : Using Factory Methods we can create object refference for an class ...
Read Answers (4) | Asked by : chandu

Latest Answer : we can create object in different ways1.new operator2.class.forName3.newInstance4.object.clone ...
Read Answers (4) | Asked by : chandu

When we are sending the serialized array object thro the network, what is being passed ? is the value or the reference ?
Read Answers (5) | Asked by : aadi

Latest Answer : No. Java is not 100 % Pure OOP because of following three reasons: 1) It doesnot support Multiple inheritance. 2) It allows use of primitive data types which are not an objects.3) It allows static methods to call without creating the instance. This disobeys ...
Read Answers (7) | Asked by : Beena


 Sponsored Links

 
Related Articles

Service Oriented Java Business Integration Review

Service Oriented Java Business Integration Review Introduction If you ve read through the texts which give you an introduction to SOA or Web Services you will often find them to be quite frustrating and the reason for this is because they spend too much time referencing business processes which are
 

ODP.NET - OracleCommand Object

ODP NET More About the OracleCommand Object Till now we have seen OracleCommand working with OracleDataReader OracleCommand is not simply meant for OracleDataReader It has got a lot of functionality for itself Let us see few of the most commonly used features of OracleCommand in this section We will
 

Microsoft AJAX Library - Creating Object Members on the Fly

Creating Object Members on the Fly One major difference between OOP in C and ASP NET and OOP in JavaScript is that JavaScript allows creating object members on the fly" This is true for objects and classes that you create yourself and also for JavaScript s own objects and types as well He
 

Microsoft AJAX Library - Object-Oriented JavaScript

Object Oriented JavaScript Objects and classes are implemented differently in JavaScript than in languages such as C VB NET Java or C However when it comes to using them you ll feel on familiar ground You create objects using the new operator and you call their methods or access their fields using t
 

Concepts of Object-Oriented Programming

Object Oriented JavaScript In this chapter you ll learn about OOP Object Oriented Programming and how it relates to JavaScript As an ASP NET developer you probably have some experience working with objects and you may even be familiar with concepts such as inheritance However unless you re already a
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

Java and Client Server Models

Java and Client Server Models The Role of Client Servers on the Web Client server models provide the essential mechanisms for working with the Internet In fact most of the World Wide Web is built according to this paradigm In client server models the web browsers run by millions of users are the cli
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

Object-Oriented Client-Server Internet

Object Oriented Client Server Internet OCSI Environments as IT Infrastructure Client Server Basics Object Oriented Client Server Internet OCSI environments provide the IT infrastructure for supporting OCSI applications For our purposes infrastructure refers to operating systems networks middleware
 

JavaScript String Object

JavaScript String Object In this JavaScript tutorial you will learn about String Object purpose of string object in JavaScript purpose of string object indexof method lastIndexOf method and substring method along with syntax and example mosgoogle center Purpose of String Object in JavaScript The mai
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape