There have been many technical answers that are JLS Section 1.2, Checked exceptions etc which explains the use of it.
But your question
When should I announce throws an Exception, and when not, and just throw it without declare about it?
If your code is generating some explicit exception and throwing it, then you should always add throws clause and you should generate documentation by just writing /** above the function which will generate the documentation tags for you. This will help all the other users who use your library or functions that the certain function or constructor is bound to throw an exception if some invalid arguments or some values have not been initialized prior to call of this function.
Example,
/**
*
* @param filePath File path for the file which is to be read
* @throws FileNotFoundException In case there exists no file at specified location
* @throws IllegalArgumentException In case when supplied string is null or whitespace
*/
public static void ReadFile(String filePath) throws FileNotFoundException, IllegalArgumentException
{
if(filePath == null || filePath == "")
throw new IllegalArgumentException(" Invalid arguments are supplied ");
File fil = new File(filePath);
if(!fil.exists()|| fil.isDirectory())
throw new FileNotFoundException(" No file exist at specified location " + filePath);
//..... Rest of code to read file and perform necessay operation
}
These documentation tags and throws are moreover to make the programmer life easy who will reuse your code and will know in advance that IllegalArgumentException, FileNotFoundException will be thrown if function is invoked with wrong parameter or file is not available at specified location.
So if you want that your code and functions are self explanatory and provides all necessary cases what exceptions are thrown then add the following clauses otherwise it is your choice.
Remember, if after 30 days if you yourself are using (I am sure you are going to re-use it near future) those function then it will be much more helpful and you will exactly know just by those clauses what I did in that function.