Results 1 to 2 of 2
Thread: very basic code
- 10-14-2008, 01:15 PM #1
Member
- Join Date
- Oct 2008
- Posts
- 2
- Rep Power
- 0
very basic code
Hi im a complete beginner and seem to be falling at the first hurdle here :(
I am using BlueJ and working with the picture project that the BlueJ book came with.
so i added another field -1. Add a second sun to the picture. To do this, pay attention to the field definitions close
to the top of the class. You will find this code:
private Square wall;
private Square window;
private Triangle roof;
private Circle sun;
private Circle sun;
Then im being asked to write the appropriate code for creating the second sun, but i cant seem to find any existing code creating the first sun :confused: my attempt at answering is -
This is in another class named Circle
but i know this is wrong.. can someone point me in the right direction?Java Code:/** * Create a new circle at default position with default color. */ public Circle() { diameter = 30; xPosition = 20; yPosition = 60; color = "blue"; isVisible = false; } /** * create second sun? *(my input) */ public Circle sun2() { diameter = 30; xPosition = 40; yPosition = 80; color = "yellow"; isVisible = false; }
- 10-14-2008, 01:40 PM #2
Senior Member
- Join Date
- Aug 2008
- Location
- Stockholm, Sweden
- Posts
- 119
- Rep Power
- 0
Similar Threads
-
basic java help
By adred in forum New To JavaReplies: 0Last Post: 03-08-2008, 12:36 PM -
Basic Applet
By jkswebsite in forum Java AppletsReplies: 4Last Post: 01-13-2008, 09:14 PM -
Very basic question
By gvi in forum New To JavaReplies: 2Last Post: 10-30-2007, 06:30 PM -
help with basic java code
By elizabeth in forum New To JavaReplies: 1Last Post: 08-07-2007, 06:47 PM -
help with basic example
By fred in forum New To JavaReplies: 1Last Post: 07-20-2007, 05:45 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks