Why is everything inside class Dog?


#1

https://www.codecademy.com/courses/learn-java/lessons/object-oriented-programming/exercises/using-methods-1?action=lesson_resume

In this section of the code i have no idea why everything including the main is inside the dog class. Please help.



#2

All code in Java must be contained inside of a class so it may be referenced from other classes and methods.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.