Answer Posted / shahid
there is one "locha" in paragraph one of answer number 1.
since local classes are also inner classes which are defined within any block and that block can be a method's body.
class OuterSpace {
private String MessageComming = "is any body there";
void receiveMessage() { //outer c;lass method
class InnerSpace { //defining class in outter class method
public void receivingMessage() {
System.out.println("message send by eline is" +MessageComming);
}
}
}
}
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Explain about method local inner classes or local inner classes in java?
What is immutable in java?
What is namespace in java?
Do you know why doesn't the java library use a randomized version of quicksort?
Can we override private constructor in java?
Is java same as core java?
Why singleton class is used in java?
Garbage collection in java?
How does linkedhashmap work in java?
Can a constructor be protected?
What are constructors in java?
What are heap memory and stack memory and what are memory tables.
What is difference between classpath and path variables in java?
What are the two types of exceptions in java? Which are the differences between them?
Are constructors methods?