Below is one solution as far as i understood your problem.
And if you want to return three integers, you can return them as an array in the simplest way (or you can create another object to hold all three integers).
package Chapter4;
import java.awt.*;
import java.util.Random;
public class RandomColor {
int r, g, b;
private RandomColor(int r, int g, int b) {
this.r = r;
this.g = g;
this.b = b;
}
public static RandomColor createRandomColor(){
Random generator = new Random();
int r = generator.nextInt(255);
int g = generator.nextInt(255);
int b = generator.nextInt(255);
RandomColor c = new RandomColor(r,g,b);
return c;
}
public String toString() {
return "R: "+r+" G: "+g+" B: "+b;
}
public static void main (String []args){
RandomColor pickcolor = RandomColor.createRandomColor();
System.out.println(pickColor);
}
}