Java is an object-oriented programming language. It not only absorbs the various advantages of the C language, but also abandons the difficult-to-understand concepts such as multiple inheritance and pointers in C. Therefore, the Java language has two characteristics: powerful functions and simple and easy to use. .
isDirectory() in java checks whether an object is a folder. The return value is of type boolean. Returns true if so, false otherwise.
The calling method is: object.isDirectory() without specifying parameters.
Example:
String path="C:/windows/Help"; //我随便给的一个目录 File f=new File(path); //new的一个File对象 if(f.isDirectory()){ //如果path表示的是一个目录则返回true .... }
For more java knowledge, please pay attention to java basic tutorial.
The above is the detailed content of Java determines whether it is a folder. For more information, please follow other related articles on the PHP Chinese website!