codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  do static member are inherited  pramod at 07:34 on Monday, May 15, 2006
 

do static member and static functiin of a base class is inherited by a derived class

  Re: do static member are inherited  miteshbhimjiyaani at 09:44 on Tuesday, May 16, 2006
 

yes , u can access that method in derived class.


class A{
static void disp()
{
System.out.println("hello");
}
}

class B extends A {

public static void main(String args[])
{
B b=new B();
b.disp();
A.disp();
}
}

  Re: do static member are inherited  vector at 13:25 on Saturday, May 20, 2006
 

No you can not

#include<iostream>
using namespace std;
class A{
public:
static void disp()
{
cout<<"hello";
}
};

class B:public A
{

public:


} ;
int main()
{
B *b=new B();
b::disp();
A::disp();
return 0;
}









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  session time out
•  Scroll To Not Fully working in IE...
•  Re: document.write in IE and Mozilla/Netscape.
•  Re: info out of an video example
•  Re: Help: Trouble with z-Index and SELECT lists
•  perl siganl handling in Term::Readline
•  position of a page inside a pop-up in javascript
•  Ugent Help needed
•  java help questions


Recent Articles
Javascript OnMouseDown
Pointer types and Arrays
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts


© Copyright codetoad.com 2001-2006