Results 1 to 11 of 11
Thread: Help with code : Ultra Noob
- 08-20-2012, 06:48 PM #1
Member
- Join Date
- Apr 2012
- Location
- Gujarat , India
- Posts
- 5
- Rep Power
- 0
Help with code : Ultra Noob
I am trying to learn Java & I am extremely noob, hope this forums help me. :-/
In the following code i am trying to get width & height and print area of rectangle. what's problem?
Java Code:public class SomethingIsRight { public static void main(String[] args) { public Rectangle (int width, int height) { area = width*height; } Rectangle myRect = new Rectangle(40,50); System.out.println("myRect's area is " + myRect.area()); } }
-
Re: Help with code : Ultra Noob
- 08-20-2012, 08:48 PM #3
Re: Help with code : Ultra Noob
You didn't bother to return to either of the first two threads you started. You didn't bother to check out the link I posted in the second thread. This third thread is once again a violation of the forum rules.
Do you really expect the forum members to try to help you?
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 08-21-2012, 06:19 PM #4
Member
- Join Date
- Apr 2012
- Location
- Gujarat , India
- Posts
- 5
- Rep Power
- 0
Re: Help with code : Ultra Noob
I just want to know that how to find area of rectangle!
You didn't bother to return to either of the first two threads you started. You didn't bother to check out the link I posted in the second thread. This third thread is once again a violation of the forum rules.
Do you really expect the forum members to try to help you?
db
- 08-21-2012, 06:34 PM #5
Student
- Join Date
- Jul 2012
- Location
- United States
- Posts
- 328
- Rep Power
- 8
Re: Help with code : Ultra Noob
The problem is that you define a constructor for class Rectangle inside the main method of class SomethingIsRight.
Another problem is that you call the undefined method area().
I recommend that you start with the Hello World Tutorial. Then, start learning about Objects and Classes plus other elements of the Java language."Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill
- 08-21-2012, 06:41 PM #6
Student
- Join Date
- Jul 2012
- Location
- United States
- Posts
- 328
- Rep Power
- 8
Re: Help with code : Ultra Noob
You can view all of your posts by clicking on "My Profile" at the top-right portion of the screen. Then Click on "Find latest posts" on the left side of the screen.
Also, you don't have to put the word "noob" in all of your thread titles. If you are posting in the New to Java section, people assume that you are a beginner at Java."Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill
-
Re: Help with code : Ultra Noob
- 08-21-2012, 07:59 PM #8
Student
- Join Date
- Jul 2012
- Location
- United States
- Posts
- 328
- Rep Power
- 8
Re: Help with code : Ultra Noob
"Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill
-
Re: Help with code : Ultra Noob
No you're OK in posting what you've posted. It's time to be blunt I think.
- 08-22-2012, 05:19 PM #10
Member
- Join Date
- Apr 2012
- Location
- Gujarat , India
- Posts
- 5
- Rep Power
- 0
Re: Help with code : Ultra Noob
Thank you all! I was already going through tutorial! Then I founded another site & it helped me alot! Thank you a lot friends!!! :D
-
Re: Help with code : Ultra Noob
Similar Threads
-
Very noob : Pls describe this code :P
By deepode in forum New To JavaReplies: 2Last Post: 07-24-2012, 08:53 PM -
I am a super noob with a super noob question.
By LittleZoppo in forum Java AppletsReplies: 3Last Post: 04-27-2012, 04:50 AM -
Java Ultra-Lite Persistence 3.0.2
By java software in forum Java SoftwareReplies: 0Last Post: 10-10-2011, 06:59 PM -
Help im a noob.. a super noob on java..
By critdevil in forum New To JavaReplies: 12Last Post: 03-07-2009, 04:17 AM -
Noob
By nokomis in forum IntroductionsReplies: 2Last Post: 03-06-2009, 06:10 PM
Bookmarks