Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javaidentifier

 
ojak dev
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can a function can be accessed in a class from another class that has no main function
 
Adam Altmann
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, there's only ever one main method.
Yes, you can access functions in one class from another class. It just depends on which access modifiers (Public, Protected, Private, (Default)) are in place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic