java - Creating setColor method without parameter being passed? -


I am working on a homework project for an introduction to Java course. In order to organize the calling methods and functions, we have to modify two colors of the balloon objects S1 and S2 and using the methods in a separate Java class, modify their color and height.

All I have is fine, but not quite right Assignment requirements list the list of announcements of the sheet and can not be changed, only the code inside them can be.

The method that is used to change the balloon color is to be made as public void setColor () . I do not understand this, though. I am using public zero set collar (string color) for now.

How can I change the property of the color of a balloon object without passing anything from the settler method?

  Public Zero Set Collar () {int red, green, blue; Red = green = blue = 0; Random random = new random (); Int high = 255, less = 0; Red = random.nextInt (high-low) + less; Green = random. NXIT (high-low) + less; Blue = random.xitINt (high-low) + less; Color = new color (red, green, blue); // Set this color in your bubble)  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -