The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes paint Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "paint" Watch "paint" New topic
Author

paint

josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
This is from amock exam
answer given is 1 . 3 also appears correct right??
which compile withouut error
public void paint(Graphics g){
int polyX[] ={1,2,3}
int polyY[] ={4,2,3}
g.drawPolygon(polyX,polyY,3)
}

public void paint(Graphics g){
int polyX[] ={1,2,3}
int polyY[] ={4,2,3}
g.drawPolygon(polyX,polyY)
}

public void paint(Graphics g){
int polyX[3] ={1,2,3}
int polyY[3] ={4,2,3}
g.drawPolygon(polyX,polyY,3)
}

public void paint(Graphics g){
int polyX[] ={1,2,3}
int polyY[] ={4,2,3}
drawPolygon(polyX,polyY,3)
}
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18652
Well, what happens when you try to compile it? That should answer your question.


"I'm not back." - Bill Harding, Twister
josephine chen
Ranch Hand

Joined: Oct 29, 2002
Posts: 216
I got it for the 3rd option it is like
int polyX[3] ...which is wrong way of declaring an array
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18652
I can't tell what you mean, but if you tried it you must have gotten a compile error, which should answer your question.
 
 
subject: paint
 
Threads others viewed
Access a variable
Paint() method... Easy Question
Logos or Pics for JPanel
Applets and images...
draw a polygone
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture