Go Back   Java Programming Forums > Java Standard Edition Programming Help > Java Theory & Questions


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-03-2010, 12:53 AM
Junior Member
 

Join Date: Feb 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
cejay is on a distinguished road
Default why is this there and what does it do?

Java Code
public class Sprite {
	/** The image to be drawn for this sprite */
	private Image image;
	
	/**
	 * Create a new sprite based on an image
	 * 
	 * @param image The image that is this sprite
	 */
	public Sprite(Image image) {
		this.image = image;
	}
why is there two Images? what does the first do and what does the second do? im confused and ive seen this with the word game as well.

i've noticed that the capitalization are different but i don't understand the purpose. if any one could try to elaborate that would be stupendous. =)



Reply With Quote Share this thread on Facebook
Sponsored Links
Java Training from DevelopIntelligence
  #2 (permalink)  
Old 02-03-2010, 09:43 AM
Junior Member
 

Join Date: Mar 2010
Location: Mauritius
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Wanderer is on a distinguished road
Default Re: why is this there and what does it do?

Hi cejay

By two images, I am guessing you are referring to the following lines
Java Code
 public Sprite(Image image)
The first Image is the referring to the class Image. The second is just a variable name. The following also works
Java Code
public Sprite(Image img)
It just means that the variable image is an object of the class Image

Cheers
(prit4u.wordpress.com)

Last edited by Wanderer; 02-03-2010 at 09:46 AM.
Reply With Quote
  #3 (permalink)  
Old 02-03-2010, 04:58 PM
Junior Member
 

Join Date: Feb 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
cejay is on a distinguished road
Default Re: why is this there and what does it do?

oh! thats why it is lower case on the second one! thanks man =). that cleared some stuff up lol.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




100 most searched terms
Search Cloud
2 dimensional arraylist java 2d arraylist java actionlistener actionlistener in java addactionlistener addactionlistener java convert double to integer java double format java double to integer in java double to integer java drag en drop programmeren java eclipse shortcut keys exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double in java format double java get mouse position java java 2d arraylist java actionlistener java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming practice problems java send keystrokes to another application java two dimensional arraylist java.io.ioexception: premature eof java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton action jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics smack api two dimensional arraylist two dimensional arraylist java unable to sendviapost to url what is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

All times are GMT. The time now is 01:54 AM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.