Serial.begin() & Wire.begin() - Class constructor or object?

Hi Great Arduino community, I am new to Arduino programming. I am baffled by the way Serial.begin() & Wire.begin() syntax is used. Are the "Serial" or "Wire" here constructors of the class or are they objects? If they are constructor, why are they follow by the .begin() function and not the declaration of an object? If they are object, then where is the declaration of the object?

https://www.arduino.cc/en/reference/wire

If you open both "Serial" and "Wire" .CPP & .H...
You might find some helpful code as to why it does what it does.

Serial is an instance of a class that is instantiated for you when using the Arduino environment. Which class it's an instance of depends on which board you're compiling for.

On an Uno, it's an instance of the HardwareSerial class. This class inherits from the abstract class Stream which, in turn, inherits from the abstract class Print.

On the ARM-based Teensy 3.2 board, Serial is an object of the class usb_serial_class which inherits from Stream.

Same story with Wire. On an Uno, it's a pre-instantiated instance of the TwoWire class that inherits from Stream.

tsliew:
I am baffled by the way Serial.begin() & Wire.begin() syntax is used. Are the "Serial" or "Wire" here constructors of the class or are they objects? If they are constructor, why are they follow by the .begin() function and not the declaration of an object? If they are object, then where is the declaration of the object?

There are Arduino operations that are not safe to perform until the Arduino run-time (millis(), etc) has been initialized. The run-time is not initialized until AFTER all global objects are constructed so there are some operations that CAN'T be done in the object constructor. For those operations an object will have a method that you call (typically in setup()) to complete the initialization of the object. By Arduino convention this method is named ".begin".

Hi Arduino Forum, thank you all for your answers to my question. You guys have been really helpful. Cheers.