Rename File in Java

Lumayan buat dokumentasi pribadi :D. It is, java code..


public class Rename{
   public static void main (String args[]) throws IOException{
     File oldFile = new File("OLD.txt");
     oldFile.renameTo(new File("NEW.txt"));

Pastikan program java ini berada satu folder dengan file yang akan direname

compile: javac

running: java Rename


About windupurnomo

I'm interested in programming. I am active with several programming such as Java, C #, C, JavaScript, HTML. I'm also develop desktop application (Java Swing), Mobile Application (Android), and Web programming (ASP MVC).
This entry was posted in Java and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s