grep for capital words

view story

http://unix.stackexchange.com – I have a file that has declarations in it with capital words, something like: public final Foo BAR; these declarations are not all uniform. Is there a way for me to grep out just the capital lettered words from the line? I know how to find lines that have capital letters in them, but thats not what I want. I want only the matching capital lettered word. Thanks! (HowTos)