3:42 pm - Friday November 18, 4596

File program Constructs a file: URI that represents this abstract pathname

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

// program  Constructs a file: URI that represents this abstract pathname. //

//Author:Candid Java//

//Description: This program describes about toURI method Constructs a file: URI that represents this abstract pathname//

import java.io.*;

import java.net.*;

class touri

{

public static void main(String args[]) throws Exception

{

//specify file path

File f1=new File("E:\5-jan\toStringDemo.txt");

//converts file path to Uniform Resource Identifier

URI uri=f1.toURI();

System.out.println("URI:"+uri);

}}

 

OUTPUT:

D:candidjava /io/file> javac  touri.java

D:candidjava /io/file> java ttouri

URI:FILE:/E:/5-jan/%05-jan%09oStringDemo.txt

Filed in: Z-A All Java Codes

No comments yet.

Leave a Reply