c# - What is the error "member names cannot be the same as their enclosing type" means when creating a constructor, and how to solve it? -


when tring create constructor class same class name. why throws error saying follows:

" error: 'staveprocessor': member names cannot same enclosing type"

code :

namespace imageprocessing {     class staveprocessor     {         public bitmap stave;          public staveprocessor(bitmap image) //constructor         {             stave = image;         }     } } 

how solve , create constructor?

ps: please consider self not expert , excuse me asking silly question if, , me learn , identify. thank you

well code you've provided has no issues in (it compiles), exception you're getting show if did following:

class staveprocessor {     // can't have method name (note void, it's not constructor)     public void staveprocessor(bitmap image)     {         stave = image;     } } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -