what is inner class?

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


Please Help Members By Posting Answers For Below Questions

Explain about method local inner classes or local inner classes in java?

569


What is immutable in java?

539


What is namespace in java?

541


Do you know why doesn't the java library use a randomized version of quicksort?

552


Can we override private constructor in java?

502






Is java same as core java?

584


Why singleton class is used in java?

566


Garbage collection in java?

587


How does linkedhashmap work in java?

515


Can a constructor be protected?

529


What are constructors in java?

563


What are heap memory and stack memory and what are memory tables.

505


What is difference between classpath and path variables in java?

549


What are the two types of exceptions in java? Which are the differences between them?

508


Are constructors methods?

565