• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Strange string constructor compile error

Hi,

I made a class like:

    public class Whatever
    {
        public void Whatever(String str);
    }

I'm using it in some other file like:

    Whatever w = new Whatever("hello");

but the compiler is complaining that it can't find a constructor for Whatever that takes a String. Why would this be happening? I'm using other functions as part of the same / other classes that take a string as a parameter, no problem...

Thanks
0
DJ_AM_Juicebox
Asked:
DJ_AM_Juicebox
1 Solution
 
objectsCommented:
ctor do not have return type

    public class Whatever
    {
        public Whatever(String str)
        {
        }

    }
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now