Let's put together a rectangle

  • 4
OKEA sells unassembled space shuttles. They are all rectangular (we don't know why). These guys ordered a program from Company X for automatically generating shuttle instructions. You've been assigned to create a rectangle class and initializer methods for whatever life might throw at it.
You can't complete this task, because you're not signed in.
Comments(12)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Brandon LeirerLevel 5 , Keller
Thursday, 19:33
So the reading states that several initialize methods can be created in the same class, but this task seems to indicate that there are restrictions that were not covered with us. Example, it seems that (int top, int left) and (int width , int height) would cause conflicts because java just sees both of these as two integers. It would be nice to have an official explanation of what is going on here.
Nickolas JohnsonLevel 8 , St. Louis
9 March, 14:13
Adrie Taniwidjaja's explanation was the only reason this made sense to me.
HaeWon ChungLevel 16 , Boston
22 January, 03:47
I kind of agreeing what Adrie Taniwidjaja said below. The requirements should state to have 1, 2, 3, or 4 parameters not at least four initialize methods. If you pass the last requirements the other three requirements are automatically fulfilled.
LucGarLevel 19 , Bilbao
9 December 2019, 14:07
i do it, but i dont undertand nothing
Kent HerveyLevel 13
20 October 2019, 23:52
BTW, 4 is the maximum number of initializers because overiding can only be done by changing the signature which means parameter list. There are only four parameters, so that is the maximum. Java is looking for variable types, not order. So (int top, int left) and (int left, int top) looks the same and would be a conflict.
Kent HerveyLevel 13
20 October 2019, 23:39
I am starting this very confused For example: - width/height is not specified (both are 0) - height is not specified (it is equal to the width), we'll create a square So why say height not specified twice. And if square, then left=top. and if square, then width and height can't be 0 Well, somebody says that left and top are not lengths of a side, but rather the position of the left and top of the rectangle...okay I completed it with just four initialize and no method to copy another rectangle....I passed, though I do something that might give me a bad score, but saves time. I verify after every step.
Mihály DombiLevel 12 , Szeged
27 August 2019, 22:27
I made this task but I didn't know what I did. What's the point? Why there are top and left variables? They are the same I guess as width and height variables. I mean... a rectangle has 2 variables, not 4.. Somebody please explain this task. Thank you in advance..
Adrie TaniwidjajaLevel 11 , Bandung
7 May 2019, 05:25
This task's requirement is confusing. What is the meaning of the requirement No. 3 until No. 6? It should be written like this: 3. The class must have at least one initialized method with one input parameter 4. The class must have at least one initialized method with two input parameter 5. The class must have at least one initialized method with three input parameter 6. The class must have at least one initialized method with four input parameter but if you just make 4 initialized method ( 1 for each requirement) you will not completed this task. you must add another 1 initialized method. So the total number of initialized method must be 5 not 4 !
RomanLevel 41
7 May 2019, 08:02
4 initialized methods are enough to complete the task
Adrie TaniwidjajaLevel 11 , Bandung
9 May 2019, 10:27
I already try to make only 4 initialized method with many variation and I never get pass the task. But when I made them to 5 finally I can passed the task.
RomanLevel 41
10 May 2019, 06:34
Give me your codes with 4 and 5 initialized methods, please.
Brandon LeirerLevel 5 , Keller
Thursday, 19:29
I passed it with 4 initialize methods.