This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Help.explanation of code from different classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Help.explanation of code from different classes" Watch "Help.explanation of code from different classes" New topic
Author

Help.explanation of code from different classes

cornel jew
Ranch Hand

Joined: Jul 13, 2002
Posts: 37
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

Joined: Dec 10, 2001
Posts: 7023
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!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
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.



JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help.explanation of code from different classes