Wednesday 15 September 2010

Relationship between Inner and Outer Class in Java? -


This is my book. Java code

  public class book {Private int page; Number; Private Classroom BookReader {public int getPage () {Return page number; }}}  

When I compiled and used the javap then I got things for two sections

Book $ bookclick for .class

This is the output code

  "Book.jav class book $ BookReader {last book it $ 0, public int Compiled from getPage ();}  

My question is why why last has been added when making any reference here and why this reference has been made? What is its use in Qualis?

Compiled from the public class book {public book (;); Fixed $ 000 (book); Book $. (Book) for "Book.class ;}

Why has the static been added to the variable and why is the book passed in the form of the parameter here?

If possible, simple words Explain it in!

in BookReader , final Variable it will reference the conta of $ 0 BookReader Ining book example This last for each is BookReader set the example when he made example, in the manner of its creation, and can not be changed later.

Use the book in the class, the static method $ 000 class Book.BookReader for a synthetic accessor The method is. As each internal code of book , the member frequency of each BookReader is allowed to be included, but the Java Runtime does not really know it, and in the class file format There is no special representation for this. private member Book.pageNumber

for BookReader, therefore, the compiler class The book creates a synthetic, default-access method for that purpose in , and the method that writes the use of the external square variables in the form of a reference in BookReader .


No comments:

Post a Comment