thaiall logomy background
coding : j0601.java.
my town
Source : Perl | PHP | ASP | JSP | HTML | HTML5 | JavaScript | Java | COBOL | C++ | MS Access | VBNet | VB | Python | โค้ดดี
File : j0601.java. ID : j0601
Skin : Default | Sons-of-obsidian | Sunburst | Highlighter | Full
// program id : 21
// try on c:/windows/win.ini 
import java.io.*;
public class j0601 {
  public static void main (String args[]) throws IOException {
    File f = new File("c:/windows/win.ini");
    System.out.println("getName: "+f.getName());
    System.out.println("getPath: "+f.getPath());
    System.out.println("getAbsolutePath: "+f.getAbsolutePath());
    System.out.println("exists: "+f.exists());
    System.out.println("isFile: "+f.isFile());
    System.out.println("isDirectory: "+f.isDirectory());
    System.out.println("canWrite: "+f.canWrite());
    System.out.println("canRead: "+f.canRead());
    System.out.println("length: "+f.length());
    // create hello1.txt have 0 byte
    File file = new File("hello1.txt");
    boolean success = file.createNewFile(); // 0 byte
    // move hello1.txt to hello2.txt
    File file2 = new File("hello2.txt");
    success = file.renameTo(file2);
    // move hello2.txt to c:/hello2.txt
    File b = new File("c:/");
    success = file2.renameTo(new File(b, file2.getName()));
    // if(!found) then can not delete & success = false
    success = (new File("hello2.txt")).delete();
    System.out.println("Delete hello2.txt : " + success); // false
    // if (found) then delete & success = true
    success = (new File("c:/hello2.txt")).delete();
    System.out.println("Delete c:/hello2.txt : " + success); // true
  }
}
จำนวน : 32 บรรทัด
าษาเฮชทีเอ็มแอล (HTML = HyperText Markup Language) คือ ภาษาคอมพิวเตอร์ที่ออกแบบมาเพื่อใช้ในการสร้างเว็บเพจที่เรียกดูผ่านทางเว็บเบราว์เซอร์ (Web Browser) เริ่มพัฒนาโดย ทิม เบอร์เนอรส์ ลี (Tim Berners Lee) ในปัจจุบัน HTML ล่าสุดคือ รุ่น 5 เป็นมาตรฐานหนึ่งของ ISO ซึ่งจัดการโดย World Wide Web Consortium (W3C) ในปัจจุบัน ทาง W3C ผลักดัน รูปแบบของ HTML แบบใหม่ ที่เรียกว่า XHTML รุ่นแรกคือ 1.0 (ม.ค.2543) ซึ่งมีโครงสร้างเป็นแบบ XML (eXtensible Markup Language)
ตัวอย่าง Hello World
ปรับปรุงโปรแกรม source.pl : 2565-07-24
rspsocial
Thaiall.com