File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes invoking methods while inside methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "invoking methods while inside methods" Watch "invoking methods while inside methods" New topic
Author

invoking methods while inside methods

Mike Smith
Greenhorn

Joined: Jul 28, 2006
Posts: 9
I'm practicing methods by re-writing programs from class, but putting every little step into a method. (Clearly not practical, just for the practice of using methods)

But when I try and invoke the Math.random() method while already inside a method, I get the error ".class expected," and I'm not sure why, because I'm still in the same Main class where the Main method is, so...



[ August 02, 2006: Message edited by: Mike Smith ]
[ August 02, 2006: Message edited by: Mike Smith ]
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
i know it's not what you are looking for:
- please always post the full error
- take care of identation
- always use curly braces (for/if/do-while/while/...) even if the block only contains one statements

perhaps if you post cleaned up code and the full error someone can help you.

pascal
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

- always use curly braces

This is particularly true here


[My Blog]
All roads lead to JavaRanch
Mike Smith
Greenhorn

Joined: Jul 28, 2006
Posts: 9
I solved my problem, thanks anyway...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invoking methods while inside methods