d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Paying For Java Project
Prev12
Add Reply New Topic New Poll
Member
Posts: 1,781
Joined: Mar 16 2007
Gold: 0.00
May 2 2013 04:32pm
I realized this http://www.cs.albany.edu/~sdc/CSI201/Spr13/Labs/L10/L10.pdf is also needed to complete the project.

I started this and got stuck on question 3, my code so far looks like:

Code

public class House
{
 String owner;
 
 public House(String param)
 {
   this.owner = param;
   
   Picture fPRef = new Picture(FileChooser.pickAFile());
   Picture[] hPix;
   this.hPix = new Picture[3];
   
 }
 public String toString()
 {
   return("House owned by" + this.owner);
   
 }
 
public addPic(Picture favPic)
{
 
favPic = fPRef;
this.show(fPRef);

 
}
}
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
May 2 2013 05:07pm
oh boy.

1. read up on class variables vs. method variables vs. method parameters
2. look at the line
Code
favPic = fPRef;

and think about all the kinds of wrong this line is
3. think before you write any more code.

This post was edited by irimi on May 2 2013 05:08pm
Member
Posts: 13,028
Joined: Oct 24 2008
Gold: 0.00
May 3 2013 03:56pm
Quote (irimi @ May 2 2013 04:07pm)
oh boy.

1. read up on class variables vs. method variables vs. method parameters
2. look at the line
Code
favPic = fPRef;

and think about all the kinds of wrong this line is
3. think before you write any more code.


sure that's proper instruction but this guy looks and sounds like he does not know what he's doing. no offense. in any case tell him to think about writing code, especially when he doesn't know what to think about isn't the best advice you can give.

Quote (irimi @ May 2 2013 04:07pm)

1. read up on class variables vs. method variables vs. method parameters


better advice
Member
Posts: 4,605
Joined: Sep 15 2011
Gold: 9,464.00
May 4 2013 12:59am
"think before writing" is always good advice. you'd be surprised at how little people, especially (but not only) beginners, actually do it.
Member
Posts: 13,028
Joined: Oct 24 2008
Gold: 0.00
May 4 2013 01:26am
Quote (irimi @ May 3 2013 11:59pm)
"think before writing" is always good advice.  you'd be surprised at how little people, especially (but not only) beginners, actually do it.


yes it is good advice, but saying that to someone who doesn't know what to think or how to think is a little.... useless, wouldn't you think? it's like asking why a baby is crying. Well it's a baby and that's all it knows to do, it doesn't know better yet
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll