The Data Mining Forum                             open-source data mining software data mining conferences Data Science for Social and Behavioral Analytics DSSBA 2022 data science journal
IMPORTANT: This is the old Data Mining forum.
I keep it online so that you can read the old messages.

Please post your new messages in the new forum: https://forum2.philippe-fournier-viger.com/index.php
 
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.