• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Transfer a variable from the Main Class file to the Class file of an Object

New Here ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

Hello,

 

I would like to know if someone can help me with this question.

I want to transfer the value of a variable from the main class file to the class file of an object. How can I access the value of the variable in the main class from within the object class file?

Thanks for helping with this question.

 

Franciska Du Toit

 

 

Views

118

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 06, 2021 Jul 06, 2021

Just write a public "getter" function in the main class that returns the value of the variable.

Votes

Translate

Translate
LEGEND ,
Jul 06, 2021 Jul 06, 2021

Copy link to clipboard

Copied

Just write a public "getter" function in the main class that returns the value of the variable.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

LATEST

Thanks ClayUUID - that was the help I needed. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines