+ 1

Import problem

I want to write method and main in diferent file (same folder) but i can't import method to main file. Is there any problems? Do i have to create package to keep them?

11th Feb 2019, 4:26 PM
Ngọc Đoàn
Ngọc Đoàn - avatar
1 Odpowiedź
+ 2
I will assume you put the method in its own class and then created a new instance of said class in the main. If you did the above, then yes, all the files that make up your program should be in the SAME package.
1st Mar 2019, 11:03 AM
Marcia
Marcia - avatar