Can I pass a variable that doesn't belong to the class of the object after the dot operator


can I pass a variable that does not belong to the characters class (in this case)? Is there any way of doing this?(I used chars short for characters)

What are you trying to do here? why are you adding "chars." ?

its short for characters

2 Answers

2

What you are looking for is Fluent Interface

Hi,

No, you can’t pass a variable that doesn’t belong to the class of the object after the dot operator. The dot operator is used to access attributes or methods of the class instance. You need to use methods or parameters to pass external variables.

Best regards,

Micheal