Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Kawal Oberoi
6,429 PointsWhere did I got wrong. OMG!! ; - ;
Please help! ; - ;
// Enter your code below
class Shape(){
var numberOfSides: Int
init(numberOfSides: Int){
self.numberOfSides = numberOfSides
}
}
let someShape = Shape()

Greg Kaleka
39,018 Pointssugabelly, you've got a capitalization error on the numberOfSides property. Tiny typos can cause cause big headaches!
1 Answer

Greg Kaleka
39,018 PointsHi Kawal,
Two small issues with your code:
- When declaring a class, you don't need opening and closing parentheses. This isn't a function, and we're not creating a class instance.
- When you do create an instance of Shape, you have to use the initializer you just created, which takes one argument - an integer for the number of sides.
I think you can take it from here!
Cheers
-Greg

Kawal Oberoi
6,429 PointsFixed! Yay!
But Seriously man, Object Oriented Programming is pretty confusing. Especially when we are declaring so many values etc. There should be some analogy to make it easier.

Greg Kaleka
39,018 PointsIt's hard to wrap your head around, for sure! You'll get it though. Keep working on it!
sugabelly
2,524 Pointssugabelly
2,524 PointsI'm having the same problem. What's wrong with my code?