What is the equivalent of JavaFX from the constructors that accepts arguments?

I'm sure that there are no constructors in JavaFX because I read somewhere that but how can I get a similar result?

For example, the goal of the program that I do is simulate a really basic car race and I want to be able to use the code to be red or blue or something else. The equivalent of Java I think East:
Car car = new Car(Color.RED);
and the manufacturer of the car class to be:
public Car(Color color)
{
    this.color = color;
}
Any help would be greatly appreciated!
Thanks in advance!

JavaFX has no constructors, but has init and postinit constructions.
In your case, you can do without these constructions:

public class Car {
 var color:Color

} 

var car:Car  = Car {color:Color.RED};
}

Tags: Oracle

Similar Questions

Maybe you are looking for

  • Mouse Bluetooth disconnects randomly the macbook pro

    So, I have a logitech bluetooth mouse (M535) and sometimes it disconnect random for my mac and then reconnect a few moments later... Is there a reason that this is happening, or is it possible to fix it?

  • Re: Satellite NB10T-A-101 - cannot boot from USB key

    Hello I bought a new Toshiba Satellite NB10T-A-101 and want to improve performance by changing the HDD with a SSD and install windows Pro 8.1. However, I am unable to boot from USB, it always mention:+ Reboot and select proper boot device or insert b

  • Satellite Pro A100 - can I exchange the CPU?

    Hello world I have a Satellite Pro A100-198 with a core duo processor. I would like to replace the processor of a Satellite Pro A100 830, which is Core2Duo in the Pro A100-198. They both have the same chipset-expected-they be any problem with that? T

  • Satellite M50 - wireless card disappeared

    Hey. Prolly newb question, but I just can't understand this. I can't find my WIRELESS card, my XP does not recognize it. I think I need some kind of driver for it, but I already tried to install several, including the one on this page. Problem is pro

  • Blocking of blue screen with the analog voltage (WinXP, PCI-6251)

    Hello I'm looking to solve a problem of blue screen with my measure blockingapplication, which I am developing with C++. Blocking seems manifesta little random after a variable amount (500-50 000) of voltage analogmeasures. My application needs to ma