Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Information Technology > Java > Core Java

Core Java Core Java Interview Questions, Learn by sharing Core Java Interview Questions asked in various companies, Get Career advices, Interview Procedures from Core Java experts, Post asked Core Java Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-21-2008, 05:56 PM
Dev Dev is offline
Administrator
 
Join Date: Feb 2008
Posts: 1,989
Default In Inheritance concept, i have a static method

In Inheritance concept, i have a static method in super class and i am inheriting that class to one sub class. In that case the static method is inherited to sub class or not?
Reply With Quote
  #2 (permalink)  
Old 06-09-2008, 04:52 PM
Junior Member
 
Join Date: Jun 2008
Posts: 3
Default

it is inherited into sub class
Reply With Quote
  #3 (permalink)  
Old 06-26-2008, 07:06 AM
Junior Member
 
Join Date: Jun 2008
Posts: 6
Default

ya i think it will inherited in sub class but there is no use of inherite , because it is a static class
Reply With Quote
  #4 (permalink)  
Old 06-26-2008, 07:09 PM
Junior Member
 
Join Date: Jun 2008
Posts: 16
Default

static methods are accessed using classname.methodname,
a static method
* can call only other satic methods
* it is a class method
* cannot refer to super or this keyword
* a static method cannot be a marked abstract.

only single copy of the method would b available in the memory,so there might not be a chance of overloadng a static method in the subclass,but incase if u want to access u need to access it using the classname.

Last edited by pradha; 06-26-2008 at 07:11 PM.
Reply With Quote
  #5 (permalink)  
Old 07-25-2008, 06:15 AM
Member
 
Join Date: Jul 2008
Location: West Bengal,India
Posts: 48
Default

yah it is posible to inherit a static method
__________________
Asit Kumar Purohit.
SRIC,IIT Kharagpur.
West Bengal,India
Mail me
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On