public class InnerEx7 {
public static void main(String[] args) {
Foo foo=new Foo();
Foo foo2=foo.stam(55);
foo2.print();
}
}
class Foo{
String word="bye";
void print(){} // what does this fucntion do. why do i need it if it is empty
public Foo stam(final int x){
final int y=10;
class Inner extends Foo{ // why do i need to use inheritance here?
public void SayHello() {
System.out.println("Hello");
}
@Override
void print() {
System.out.println(y*x);
System.out.println("Print "+word );
}
}
Inner inner=new Inner();
inner.SayHello();
return inner;
}
}
NewOrder -1 Posting Whiz
NormR1 563 Posting Sage Team Colleague
NewOrder -1 Posting Whiz
NormR1 563 Posting Sage Team Colleague
NewOrder -1 Posting Whiz
NormR1 563 Posting Sage Team Colleague
NewOrder -1 Posting Whiz
NormR1 563 Posting Sage Team Colleague
NewOrder -1 Posting Whiz
tong1 22 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
tong1 22 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
NewOrder -1 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
NewOrder -1 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
NewOrder commented: thanks for helping +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
NewOrder -1 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
tong1 22 Posting Whiz
NewOrder -1 Posting Whiz
tong1 22 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
tong1 22 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
tong1 22 Posting Whiz
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
NewOrder -1 Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.