This example displays the count of the named range of a spreadsheet.
System.out.println(spreadsheet.getNames().getCount());
Related information
Count property