Stuck, tragedy-Java programming (BASICS) Learning Diary

Source: Internet
Author: User

Section 8.7: file-type file. With this test, there is no response, no file, and all tests are false.

Public class testfileclass {
Public static void main (string [] ARGs ){
Java. Io. File file1 = new java. Io. File ("image/us.gif ");
System. Out. println ("does it exist? "+ File1.exists ());
System. Out. println ("Can it be read? "+ File1.canread ());
System. Out. println ("Can it be writter? "+ File1.canwrite ());
System. Out. println ("Is it a directory? "+ File1.isdirectory ());
System. Out. println ("Is it a file? "+ File1.isfile ());
System. Out. println ("Is it a absolute? "+ File1.isabsolute ());
System. Out. println ("is it hidden? "+ File1.ishidden ());
System. Out. println ("absolute path is" + file1.getabsolutepath ());
System. Out. println ("Last modified on" + new java. util. Date (file1.lastmodified ()));
}
}

If you want to get away from eclipse, you cannot go out and use cmd. You can change the JDK configuration or something. Chaos, chaos, none of them will come out, crazy, hot, sweaty, stuffy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.