• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

method dynamic loading

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have also the problem like the one's guoru posted.
another exp:
class Question { String s="Outer";
public static void main(String[] args){
S2 s2=new S2();
s2.display();}}
class S1 {String s="S1";
void display(){
System.out.println(s);}}
class S2 extends S1{
String s="s2";}
the class S2 has the display() method, inherated from S1.
wenn in main()call new S2(), is the String s="s2" also initiated?
Java initiat the variable in compile time, what is realy happen?
anyone please give some different example?

thanks

reply
    Bookmark Topic Watch Topic
  • New Topic