Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help.explanation of code from different classes

 
cornel jew
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all
I have started to learn java recently, working through books with code examples. The problem is that they don't explain you how to use it like in a real application say a fictious one, just to explain how the code fits into the whole concepts.
If someone can direct me or help me with the above i would appreciate it.
Another question is that must you create all your new objects in main or can you create it in other classes as well.
Must you define all your code in a method/subroutine?
Thanks for your help
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cornelc,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by cornelc:
Another question is that must you create all your new objects in main or can you create it in other classes as well.

You can create new objects in any class, in any method or in any field.

 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by cornelc:
Must you define all your code in a method/subroutine?


Usually. Instance initializers or static initializers can be used for some things, but most code is in methods.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic