Hi, Can you please clarify whether we should semicolon at the end of the statement or not!!. I was taking a JQ+ exam and one question was creating a layout manager. I am sure i wrote fine. It is LayoutManager layout = new GridLayout(1,2); But it gave me an error. The explanation they give was like how to create a layout what it does and all. But i think i got it wrong because of the semi-colon. TIA.
A Vinay, natarajan is correct. He's not new-ing an interface. He is using an interface reference to a GridLayout object which is allowed. Cindy is correct. You will need to add a semicolon on the real test. I asked SUN this question, and they said you should type it as though you were programming. From your statement, it looks correct. If you left off the semicolon, the statement would not have compiled. -Peter Ps. A Vinay, please see our naming policy at JavaRanch and re-register. Unless you really have people calling you "A", it would be appreciated if you would register with a complete first name. This way, if we ever run into each other, I don't have to feel bad shouting, "A...A!" (It makes me feel like I'm going through rehab.)