Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
If I take input from console or file in my main method and then using getter methods pass that data into another class and use that data in that class, would this cause duplication of data? Is it a good programming habit to do that? If not, what would you suggest to do?

What I have tried:

I was wondering if this is a good way to do stuff, if it is than I will give it a try.
Posted
Updated 25-Mar-16 2:09am

1 solution

Yes, it is the right way to handle data that belongs to a class object. See Lesson: Classes and Objects (The Java Tutorials)[^] for more information.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900