The Data Mining Forum                             open-source data mining software open-source data mining software data science journal data mining conferences
This forum is about data mining, data science and big data: algorithms, source code, datasets, implementations, optimizations, etc. You are welcome to post call for papers, data mining job ads, link to source code of data mining algorithms or anything else related to data mining. The forum is hosted by P. Fournier-Viger. No registration is required to use this forum!.  
why is super() called in the constructor for SPMF class Cluster?
Posted by: pateksan
Date: January 03, 2020 04:53PM

Hello,

I am new to java, but I'm trying to use the SPMF Hierarchical Clustering algorithm. I've been fairly lucky googling most of the questions I had, but I've come to a question which I didn't manage to answer with google:

Why is super() called in the constructor for SPMF class Cluster?

For example I found this. I noticed that super() is included in the constructors for some classes (like ClusterWithMean) but not others (like DoubleArray). Is there a reason it's included in the constructor for Cluster? Or is it totally safe to remove it?

Options: ReplyQuote
Re: why is super() called in the constructor for SPMF class Cluster?
Date: January 04, 2020 05:16AM

Hi,

Thanks for your message.

super() is a special command in Java, which calls the constructor of a super-class.

For example, calling super() in the ClusterWithMeans class has for effect of calling the constructor of the Cluster class (because Cluster is a super-class of ClusterWithMeans.

Having said that, there is no particular reasons for calling super() in Cluster because it does not extend another class. Thus, we can remove super() from Cluster.java. We could also remove super() from ClusterWithMeans because the constructor of Cluster does not do anything. I will remove them in the next version of SPMF. Thanks for pointing this out.

Best regards,

Philippe

Options: ReplyQuote


This forum is powered by Phorum and provided by P. Fournier-Viger (© 2012).
Terms of use.