Intern
Is it mandatory to create a class in Java?
sobes.tech AI
Answer from AI
Yes. Java is an object-oriented language, and all executable code must reside within classes. You cannot write standalone functions outside of a class.
sobes.tech AI
Answer from AI
Yes. Java is an object-oriented language, and all executable code must reside within classes. You cannot write standalone functions outside of a class.