create reflection in java class ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kenneth6
    New Member
    • Mar 2007
    • 79

    #1

    create reflection in java class ?

    I read a Java class example on tutorial book. What is the part marked with asterisks doing? What is "create reflection of element" in java? Any analogy in C++?

    its structure is like the following:

    public class Element {

    ............... ............... .
    .......blabla.. .....blabla
    ............... ............... .
    declare variables
    default constructor
    constructor
    accessor methods
    ............... ............... .
    .......blabla.. .....blabla
    ............... ............... .

    *************** *************** *************** ************
    public Element createReflect() {
    short [][] rMatrix = new short [height][width];
    ............... .......
    int rVC = height -1;
    int rVH = width -1;

    return new Element (rMatrix, rVC, rHC);
    }
    *************** *************** *************** ************
    }
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by kenneth6
    I read a Java class example on tutorial book. What is the part marked with asterisks doing? What is "create reflection of element" in java? Any analogy in C++?

    its structure is like the following:

    public class Element {

    ............... ............... .
    .......blabla.. .....blabla
    ............... ............... .
    declare variables
    default constructor
    constructor
    accessor methods
    ............... ............... .
    .......blabla.. .....blabla
    ............... ............... .

    *************** *************** *************** ************
    public Element createReflect() {
    short [][] rMatrix = new short [height][width];
    ............... .......
    int rVC = height -1;
    int rVH = width -1;

    return new Element (rMatrix, rVC, rHC);
    }
    *************** *************** *************** ************
    }
    What do you think it's doing here? The method is not part of the java API but is a programmer defined method and so you cannot really expect to get an analogy in c++.

    Comment

    Working...