0

quick question about what this class is returning

public static class IndexLinearizer {
    int numFeatures;
    int numLabels;

    public IndexLinearizer(int numFeatures, int numLabels) {
        this.numFeatures = numFeatures;
        this.numLabels = numLabels;
    }

The variable IndexLinearizerer, what does it return?

Say for example numFeatures = 5 and numLabels = 2.

Does it return two objects, such as = 5, 2.

Sorry folks I'm really new to Java but and familiar with Python. Thanks in advance for any help.

Richard
  • 167
  • 1
  • 3
  • 11
  • 3
    That is not a variable. – Sotirios Delimanolis Sep 20 '15 at 20:20
  • How Sotirios already said, It's not a variable. It's the constructor of the class which gets called when you create a new instance. – Bobface Sep 20 '15 at 20:48
  • Please ensure you complitelly understanding before you'll go in java deeper. IndexLinearize is class. With one public constructor. Instances of this class have 2 fields (not variables) - numFeatures and numLabels, both of type int. After constructor call you'll got instance of object. Variables - is about methods body, not about objects itself. – Pavel Uvarov Sep 20 '15 at 20:48

0 Answers0