Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Constructing a File Name path

                         

This Java programming tutorial will teach you how you can construct a file name path. By using the constructing filename path it is possible to set dynamic path, which is helpful for mapping local  file name with the actual path of the file. 

Java API has provided us many packages, one of them is java.io  package. This package contains a File class  In this example we are using one static final variable of File class i.e.. separatorChar. The value of this separator is system dependent.  If we are using Windows platform then the value of this separator is  ' \ ' .

The code of the program is given below:

import java.io.*;

public class ConstructingFileNamePath {
  public static void main(String[] args){
      String filepath = File.separatorChar + "java" + File.separatorChar + "example";
    System.out.println("The path of the file is  :  " + filepath);
       }
}

Output of this program is given below:

C:\java>java ConstructingFileNamePath
The path of the file is : \java\example

Download this example

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
panelgrid colspan
jdbc connections
intranet applications
Exercise - Pad Left
example for org.jfree.
Delete database
XML Class Constructor
Passing Parameters in
Display detailed cloc
Reading Nested dom ele
swt
page refresh
Add a file finder
Refresh a Web Page Usi
Build scripts with Gro
DOM
hibernate findall
insert fields blob
count row in resultset
token string
java programs usin pus
mysql blob
Insert an array list o
javabean program
Merge Sort In Javascri
write a program to tes
java applets
x509
connect a program writ
extract
Create XML file from f
lucene
Two Dimensional Array
file input output
username and password
HSSF clone cell
interview question
JSF 2
FileInputStream
code for how connect j
hibernate many to many
source code for chat p
set()mutator method
Tree Grid using flex
?���??���?
techiques to use subst
Photoshop Textures and
abstract
flex tutorial
jsp servlet basics
highlighting and dehig
j2me combo example
�����????�
String to array in jav
how to override...ng i
infix
factory method
call ejb j2ee5
message dialog
java write file line b
stopping actionPerform
jdbc with ms access
Applet JSP Programing
iterator
action form struts
swing program
create file folder
requestDispatcher
3DS MAX Effects Advanc
tiles2
delete data in mysql d
Flash Interactivity Sc
strust example
update checkbox row in
what is static inner c
How to Use JFrame in J
ttcn
jpa quries
Maya Effects Interpart
Photoshop Text Effects
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.