On Aug 9, 1:49 pm, Halli <[email protected]> wrote:
> I don't understand why he writes that line?
> Why does he have to create an instance of Numwords?
> One can delete this line and still the program runs smoothly. Can you
> give me the link where he explains this or if it doesn't exist, try to
> explain this for me?
>
> Thanks in advance
> -Halli
>
> import javax.swing.JOptionPane;
>
> public class NumWords {
>
> /** Creates a new instance of NumWords */
> public NumWords() {
> }
>
Actually, this is done automatically by Java, when you don't supply an
empty constructor. So, most of the time, you don't see it in the code.
But be aware you need it in some circumstances (like remoting), and
you need to write a constructor when it is not empty.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---