Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. 'Item': member names cannot be the same as their enclosing type

'Item': member names cannot be the same as their enclosing type

Scheduled Pinned Locked Moved The Weird and The Wonderful
csharphelp
29 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Paul Conrad

    PIEBALDconsult wrote:

    Why not? If I'm writing a Fibonacci method why shouldn't I put it in a class named Fibonacci?

    Exactly. Why not? If programming the class in C++, when you reference it you use something like Fibonacci::Fibonacci, which has always been clear to me what's going on.

    "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

    W Offline
    W Offline
    WilliamSauron
    wrote on last edited by
    #10

    In C# and C++ a method that has the same name as the class itself is called a "constructor"...

    -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

    P P 2 Replies Last reply
    0
    • W WilliamSauron

      In C# and C++ a method that has the same name as the class itself is called a "constructor"...

      -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #11

      WilliamSauron wrote:

      method that has the same name as the class itself is called a "constructor"...

      Thanks, but I already know that. :-D

      W 1 Reply Last reply
      0
      • P Paul Conrad

        WilliamSauron wrote:

        method that has the same name as the class itself is called a "constructor"...

        Thanks, but I already know that. :-D

        W Offline
        W Offline
        WilliamSauron
        wrote on last edited by
        #12

        Yes, I actually hoped it was so :-) What I meant is that the limitation is somehow "logical". I don't find logical to have a class named "Fibonacci" that has a method named "Fibonacci". I would rather expect methods like "generate" or "next".

        -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

        P 1 Reply Last reply
        0
        • W WilliamSauron

          Yes, I actually hoped it was so :-) What I meant is that the limitation is somehow "logical". I don't find logical to have a class named "Fibonacci" that has a method named "Fibonacci". I would rather expect methods like "generate" or "next".

          -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #13

          WilliamSauron wrote:

          Yes, I actually hoped it was so

          Yeah. With a Master's in CSCI, teaching CSCI at the college level, and over 15 years IT experience, one should know what a constructor is :-D

          "The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham

          1 Reply Last reply
          0
          • W WilliamSauron

            In C# and C++ a method that has the same name as the class itself is called a "constructor"...

            -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #14

            No, at least in C#, a constructor is named .ctor:

            System.DivideByZeroException: Attempted to divide by zero.
            at Template.Template..ctor(Int32 x)

            Like the indexer, the developer doesn't give it a name, only the return type and parameters.

            W 1 Reply Last reply
            0
            • P PIEBALDconsult

              No, at least in C#, a constructor is named .ctor:

              System.DivideByZeroException: Attempted to divide by zero.
              at Template.Template..ctor(Int32 x)

              Like the indexer, the developer doesn't give it a name, only the return type and parameters.

              W Offline
              W Offline
              WilliamSauron
              wrote on last edited by
              #15

              Ok, it's time for a little nitpicking then :-) (or, as we say in French, cutting hairs in four). Beware, I've 44 years of experience at that game :-) It means that everything I say here has absolutely no importance at all, and is by no way an attack on anyone. It's just saying something for the pleasure of saying something. The ".ctor" is not a C# name, it is a CLR/MSIL/whatever name. When I write a constructor for my C# class, I dont type ".ctor", I type the name of my class as the name of the method. Now, whether the compiler has an urgent need to create MSIL code named ".ctor" or "Groborozgruduruk" is totally irrelevant. When I program in C#, and also when I read C# code written by anyone else, I know that if a method is declared that has the same name as the class, it is a constructor. In Delphi, type casts use the same syntax as a function call, so having a function and a type with the same name is not a good idea there neither. Other languages may still have other good reasons to abhor that. This is a good reason why I agree with the compiler when it insists that I don't call my method the same name as the class. This brings the second question: as the compiler internally creates a method named "Item" as the implementation of the default indexer, does it really impose an unbearable burden on the creativity of programmers? Of course, it means that you cannot have a class named "Item" that has an indexer. But wait! Do you really think a good design would involve a class named very generically "Item" that has a default indexer (and so is itself composed of a collection of something else.) What are these called then? "SubItem" maybe? What if SubItem has itself an indexer? "SubSubItem"? "YetAnoterSubItem"? If you don't give meaningful names to your classes and methods, you are of course welcome to do so, but please don't say the compiler is restricting your creativity :-) On the other hand, now we know where the coding horror is :-)

              -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

              P L R 3 Replies Last reply
              0
              • W WilliamSauron

                Ok, it's time for a little nitpicking then :-) (or, as we say in French, cutting hairs in four). Beware, I've 44 years of experience at that game :-) It means that everything I say here has absolutely no importance at all, and is by no way an attack on anyone. It's just saying something for the pleasure of saying something. The ".ctor" is not a C# name, it is a CLR/MSIL/whatever name. When I write a constructor for my C# class, I dont type ".ctor", I type the name of my class as the name of the method. Now, whether the compiler has an urgent need to create MSIL code named ".ctor" or "Groborozgruduruk" is totally irrelevant. When I program in C#, and also when I read C# code written by anyone else, I know that if a method is declared that has the same name as the class, it is a constructor. In Delphi, type casts use the same syntax as a function call, so having a function and a type with the same name is not a good idea there neither. Other languages may still have other good reasons to abhor that. This is a good reason why I agree with the compiler when it insists that I don't call my method the same name as the class. This brings the second question: as the compiler internally creates a method named "Item" as the implementation of the default indexer, does it really impose an unbearable burden on the creativity of programmers? Of course, it means that you cannot have a class named "Item" that has an indexer. But wait! Do you really think a good design would involve a class named very generically "Item" that has a default indexer (and so is itself composed of a collection of something else.) What are these called then? "SubItem" maybe? What if SubItem has itself an indexer? "SubSubItem"? "YetAnoterSubItem"? If you don't give meaningful names to your classes and methods, you are of course welcome to do so, but please don't say the compiler is restricting your creativity :-) On the other hand, now we know where the coding horror is :-)

                -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                P Offline
                P Offline
                PIEBALDconsult
                wrote on last edited by
                #16

                WilliamSauron wrote:

                The ".ctor" is not a C# name, it is a CLR/MSIL/whatever name

                Which is the only name that matters.

                WilliamSauron wrote:

                I know that if a method is declared that has the same name as the class, it is a constructor.

                That's funny, I know that if a method is declared that has no name and returns an instance of the class, it is a constructor.

                W 1 Reply Last reply
                0
                • P PIEBALDconsult

                  WilliamSauron wrote:

                  The ".ctor" is not a C# name, it is a CLR/MSIL/whatever name

                  Which is the only name that matters.

                  WilliamSauron wrote:

                  I know that if a method is declared that has the same name as the class, it is a constructor.

                  That's funny, I know that if a method is declared that has no name and returns an instance of the class, it is a constructor.

                  W Offline
                  W Offline
                  WilliamSauron
                  wrote on last edited by
                  #17

                  PIEBALDconsult wrote:

                  Which is the only name that matters

                  Unless you target another architecture than the CLR, of course, in which case you are free to name generated symbols as you see fit. Who said that it is forbidden to directly generate IBM 360 assembly from C# ?

                  PIEBALDconsult wrote:

                  That's funny, I know that if a method is declared that has no name and returns an instance of the class, it is a constructor.

                  Funnier, my copy of "The C# Programming Language", ISBN 0-321-15491-6 by Anders Hejlsberg, Scott Wiltamuth & Peter Golde, on chapter 10.10 "Instance Constructors", page 344 has strong hints that they understand the constructor name to be similar to a method name, not a type name:

                  The identifier of a constructor-declarator must name the class in which the instance constructor is declared. If any other name is specified, a compile-time error occurs.

                  Similarly, my Visual Studio highlights the constructor as a method name, not as a type. But hey, Visual Studio is a Microsoft product, these are known not to follow recognized standards. And who knows, maybe this Hejlsberg guy is just a newbie :-)

                  -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                  P 1 Reply Last reply
                  0
                  • W WilliamSauron

                    PIEBALDconsult wrote:

                    Which is the only name that matters

                    Unless you target another architecture than the CLR, of course, in which case you are free to name generated symbols as you see fit. Who said that it is forbidden to directly generate IBM 360 assembly from C# ?

                    PIEBALDconsult wrote:

                    That's funny, I know that if a method is declared that has no name and returns an instance of the class, it is a constructor.

                    Funnier, my copy of "The C# Programming Language", ISBN 0-321-15491-6 by Anders Hejlsberg, Scott Wiltamuth & Peter Golde, on chapter 10.10 "Instance Constructors", page 344 has strong hints that they understand the constructor name to be similar to a method name, not a type name:

                    The identifier of a constructor-declarator must name the class in which the instance constructor is declared. If any other name is specified, a compile-time error occurs.

                    Similarly, my Visual Studio highlights the constructor as a method name, not as a type. But hey, Visual Studio is a Microsoft product, these are known not to follow recognized standards. And who knows, maybe this Hejlsberg guy is just a newbie :-)

                    -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #18

                    WilliamSauron wrote:

                    Unless you target another architecture than the CLR, of course

                    True, but it would still likely generate the same name, for convenience. My copies of the MS and ECMA specs say the same thing... it's an identifier, not a name.

                    W 1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      WilliamSauron wrote:

                      Unless you target another architecture than the CLR, of course

                      True, but it would still likely generate the same name, for convenience. My copies of the MS and ECMA specs say the same thing... it's an identifier, not a name.

                      W Offline
                      W Offline
                      WilliamSauron
                      wrote on last edited by
                      #19

                      PIEBALDconsult wrote:

                      True, but it would still likely generate the same name, for convenience

                      Yes, and since in some assembler languages (the one that comes to mind is Compass but there are others,) labels beginning with a dot must be local, that would make sure your constructors cannot be called from outside your module.

                      PIEBALDconsult wrote:

                      My copies of the MS and ECMA specs say the same thing... it's an identifier, not a name.

                      Yes, if you prefer calling that an identifier instead of a name (let's not reach for the scissors and talk about the subtle semantic differences between a name and an identifier.) But still a method identifier, not a type identifier. Last time I looked, the identifier denoting a constructor in my Visual Studio editor had the same black color as another method identifier, not the greenish color of my class identifier. Are they all color blind at Microsoft?

                      -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                      P 1 Reply Last reply
                      0
                      • W WilliamSauron

                        PIEBALDconsult wrote:

                        True, but it would still likely generate the same name, for convenience

                        Yes, and since in some assembler languages (the one that comes to mind is Compass but there are others,) labels beginning with a dot must be local, that would make sure your constructors cannot be called from outside your module.

                        PIEBALDconsult wrote:

                        My copies of the MS and ECMA specs say the same thing... it's an identifier, not a name.

                        Yes, if you prefer calling that an identifier instead of a name (let's not reach for the scissors and talk about the subtle semantic differences between a name and an identifier.) But still a method identifier, not a type identifier. Last time I looked, the identifier denoting a constructor in my Visual Studio editor had the same black color as another method identifier, not the greenish color of my class identifier. Are they all color blind at Microsoft?

                        -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                        P Offline
                        P Offline
                        PIEBALDconsult
                        wrote on last edited by
                        #20

                        WilliamSauron wrote:

                        Visual Studio editor had the same black color

                        Tools|Options|Environment|Fonts and Colors|Text Editor|Identifier VS doesn't discriminate between these identifiers, but I could write an editor that does. (I'll stick with Edit.) P.S. I finally got around to installing Leppie's xacc.ide -- it displays constructor identifiers in the greenish color.

                        modified on Friday, November 28, 2008 1:07 PM

                        1 Reply Last reply
                        0
                        • R Redwan Albougha

                          My schoolmate told me about a situation he faced while coding using C#. if we have the following code snippet :

                          public class Item
                          {
                          public int this[int y]
                          {
                          get
                          {
                          return 0;
                          }
                          }
                          }

                          While compiling an error will appear saying: 'Item': member names cannot be the same as their enclosing type :wtf: First I got confused, since I knew that I was defining indexer property for the class 'Item'. After I referred to MSDN I read this : Compiler Error CS0542 If your class is named 'Item' and has an indexer declared as this, you may get this error. A default indexer is given the name 'Item' in the emitted code, creating the conflict. At the end I think that this MSIL specification mustn't be exist at all.:cool:

                          Best wishes, Redwan Al-Bougha

                          L Offline
                          L Offline
                          leppie
                          wrote on last edited by
                          #21

                          Try this:

                          public class Item
                          {
                          [IndexerName("IRDUM")]
                          public int this[int y]
                          {
                          get
                          {
                          return 0;
                          }
                          }
                          }

                          xacc.ide - now with TabsToSpaces support
                          IronScheme - 1.0 beta 1 - out now!
                          ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                          R 1 Reply Last reply
                          0
                          • W WilliamSauron

                            Ok, it's time for a little nitpicking then :-) (or, as we say in French, cutting hairs in four). Beware, I've 44 years of experience at that game :-) It means that everything I say here has absolutely no importance at all, and is by no way an attack on anyone. It's just saying something for the pleasure of saying something. The ".ctor" is not a C# name, it is a CLR/MSIL/whatever name. When I write a constructor for my C# class, I dont type ".ctor", I type the name of my class as the name of the method. Now, whether the compiler has an urgent need to create MSIL code named ".ctor" or "Groborozgruduruk" is totally irrelevant. When I program in C#, and also when I read C# code written by anyone else, I know that if a method is declared that has the same name as the class, it is a constructor. In Delphi, type casts use the same syntax as a function call, so having a function and a type with the same name is not a good idea there neither. Other languages may still have other good reasons to abhor that. This is a good reason why I agree with the compiler when it insists that I don't call my method the same name as the class. This brings the second question: as the compiler internally creates a method named "Item" as the implementation of the default indexer, does it really impose an unbearable burden on the creativity of programmers? Of course, it means that you cannot have a class named "Item" that has an indexer. But wait! Do you really think a good design would involve a class named very generically "Item" that has a default indexer (and so is itself composed of a collection of something else.) What are these called then? "SubItem" maybe? What if SubItem has itself an indexer? "SubSubItem"? "YetAnoterSubItem"? If you don't give meaningful names to your classes and methods, you are of course welcome to do so, but please don't say the compiler is restricting your creativity :-) On the other hand, now we know where the coding horror is :-)

                            -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                            L Offline
                            L Offline
                            leppie
                            wrote on last edited by
                            #22

                            WilliamSauron wrote:

                            This brings the second question: as the compiler internally creates a method named "Item" as the implementation of the default indexer, does it really impose an unbearable burden on the creativity of programmers?

                            No, they provide an easy way around it. See IndexerNameAttribute.

                            xacc.ide - now with TabsToSpaces support
                            IronScheme - 1.0 beta 1 - out now!
                            ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                            W 1 Reply Last reply
                            0
                            • W WilliamSauron

                              Ok, it's time for a little nitpicking then :-) (or, as we say in French, cutting hairs in four). Beware, I've 44 years of experience at that game :-) It means that everything I say here has absolutely no importance at all, and is by no way an attack on anyone. It's just saying something for the pleasure of saying something. The ".ctor" is not a C# name, it is a CLR/MSIL/whatever name. When I write a constructor for my C# class, I dont type ".ctor", I type the name of my class as the name of the method. Now, whether the compiler has an urgent need to create MSIL code named ".ctor" or "Groborozgruduruk" is totally irrelevant. When I program in C#, and also when I read C# code written by anyone else, I know that if a method is declared that has the same name as the class, it is a constructor. In Delphi, type casts use the same syntax as a function call, so having a function and a type with the same name is not a good idea there neither. Other languages may still have other good reasons to abhor that. This is a good reason why I agree with the compiler when it insists that I don't call my method the same name as the class. This brings the second question: as the compiler internally creates a method named "Item" as the implementation of the default indexer, does it really impose an unbearable burden on the creativity of programmers? Of course, it means that you cannot have a class named "Item" that has an indexer. But wait! Do you really think a good design would involve a class named very generically "Item" that has a default indexer (and so is itself composed of a collection of something else.) What are these called then? "SubItem" maybe? What if SubItem has itself an indexer? "SubSubItem"? "YetAnoterSubItem"? If you don't give meaningful names to your classes and methods, you are of course welcome to do so, but please don't say the compiler is restricting your creativity :-) On the other hand, now we know where the coding horror is :-)

                              -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                              R Offline
                              R Offline
                              Redwan Albougha
                              wrote on last edited by
                              #23

                              First of all thanks for your reply it was really interesting to read it, especially:

                              WilliamSauron wrote:

                              but please don't say the compiler is restricting your creativity

                              WilliamSauron wrote:

                              On the other hand, now we know where the coding horror is

                              I have a lot to say, but Midterm is next week so I can't write a lot now. BYE ;)

                              Best wishes, Redwan Al-Bougha

                              1 Reply Last reply
                              0
                              • L leppie

                                Try this:

                                public class Item
                                {
                                [IndexerName("IRDUM")]
                                public int this[int y]
                                {
                                get
                                {
                                return 0;
                                }
                                }
                                }

                                xacc.ide - now with TabsToSpaces support
                                IronScheme - 1.0 beta 1 - out now!
                                ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                                R Offline
                                R Offline
                                Redwan Albougha
                                wrote on last edited by
                                #24

                                Thanks leppie, Rob Graham already told me about IndexerNameAttribute. But thanks for your interest :cool:

                                Best wishes, Redwan Al-Bougha

                                1 Reply Last reply
                                0
                                • L leppie

                                  WilliamSauron wrote:

                                  This brings the second question: as the compiler internally creates a method named "Item" as the implementation of the default indexer, does it really impose an unbearable burden on the creativity of programmers?

                                  No, they provide an easy way around it. See IndexerNameAttribute.

                                  xacc.ide - now with TabsToSpaces support
                                  IronScheme - 1.0 beta 1 - out now!
                                  ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                                  W Offline
                                  W Offline
                                  WilliamSauron
                                  wrote on last edited by
                                  #25

                                  There is no need to have a way around it through an attribute. If a class has an indexer, then it is a collection of some other things; "Item" is therefore not a good name for that class. It is a Coding Horror. Give the class an appropriate name, and you don't need the attribute...

                                  -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                                  L 1 Reply Last reply
                                  0
                                  • W WilliamSauron

                                    There is no need to have a way around it through an attribute. If a class has an indexer, then it is a collection of some other things; "Item" is therefore not a good name for that class. It is a Coding Horror. Give the class an appropriate name, and you don't need the attribute...

                                    -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                                    L Offline
                                    L Offline
                                    leppie
                                    wrote on last edited by
                                    #26

                                    WilliamSauron wrote:

                                    "Item" is therefore not a good name for that class.

                                    No, it's simply your opinion. :)

                                    xacc.ide - now with TabsToSpaces support
                                    IronScheme - 1.0 beta 1 - out now!
                                    ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                                    W 1 Reply Last reply
                                    0
                                    • L leppie

                                      WilliamSauron wrote:

                                      "Item" is therefore not a good name for that class.

                                      No, it's simply your opinion. :)

                                      xacc.ide - now with TabsToSpaces support
                                      IronScheme - 1.0 beta 1 - out now!
                                      ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                                      W Offline
                                      W Offline
                                      WilliamSauron
                                      wrote on last edited by
                                      #27

                                      Okay, your mission, should you choose to accept it, is to provide one single example where "Item" is an appropriate name for a collection class :-) If you get caught or killed, the moderator will disavow any knowledge of this thread (which will self destruct in five seconds anyway)

                                      -- Quidquid latine dictum sit, altum sonatur. http://streambolics.flimbase.com S. L.

                                      1 Reply Last reply
                                      0
                                      • R Redwan Albougha

                                        My schoolmate told me about a situation he faced while coding using C#. if we have the following code snippet :

                                        public class Item
                                        {
                                        public int this[int y]
                                        {
                                        get
                                        {
                                        return 0;
                                        }
                                        }
                                        }

                                        While compiling an error will appear saying: 'Item': member names cannot be the same as their enclosing type :wtf: First I got confused, since I knew that I was defining indexer property for the class 'Item'. After I referred to MSDN I read this : Compiler Error CS0542 If your class is named 'Item' and has an indexer declared as this, you may get this error. A default indexer is given the name 'Item' in the emitted code, creating the conflict. At the end I think that this MSIL specification mustn't be exist at all.:cool:

                                        Best wishes, Redwan Al-Bougha

                                        C Offline
                                        C Offline
                                        Camilo Sanchez
                                        wrote on last edited by
                                        #28

                                        That's right, imagine this:

                                        class Dog
                                        {
                                        public string Dog //error: you can't do this
                                        {
                                        get
                                        {
                                        return "Fido";
                                        }
                                        }
                                        }

                                        The only member names that can be the same as their enclosing type are constructors. In your case the indexer, named Item, is named like its enclosing type and is not a constructor, so, that's where your problem is coming from. To fix this, change The name of the class

                                        R 1 Reply Last reply
                                        0
                                        • C Camilo Sanchez

                                          That's right, imagine this:

                                          class Dog
                                          {
                                          public string Dog //error: you can't do this
                                          {
                                          get
                                          {
                                          return "Fido";
                                          }
                                          }
                                          }

                                          The only member names that can be the same as their enclosing type are constructors. In your case the indexer, named Item, is named like its enclosing type and is not a constructor, so, that's where your problem is coming from. To fix this, change The name of the class

                                          R Offline
                                          R Offline
                                          Redwan Albougha
                                          wrote on last edited by
                                          #29

                                          Thanks Camilo, I already know that, but I post this since it has some taste of horror. :rolleyes:

                                          Best wishes, Redwan Al-Bougha

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups