ZipFile.size() has the following syntax.
public int size()
In the following code shows how to use ZipFile.size() method.
import java.io.File; import java.util.zip.ZipFile; /*from w w w .j ava 2 s .c om*/ public class Main { public static void main(String[] args) throws Exception { ZipFile zipFile = new ZipFile(new File("testfile.zip"),ZipFile.OPEN_READ); System.out.println(zipFile.size()); } }