7:29 pm - Thursday August 17, 2017

Author Archives: veera

This Program will give you the full complete path name (filepath + filename) of a file using File.getAbsolutePath() method.

BACK   The java.io.File.getAbsolutePath() method returns the absolute pathname string of this abstract pathname. EXAMPLE PROGRAM import java.io.File; import java.io.IOException; public class AbsoluteFilePath { public static void...

This Program How to create a new File object by calling getAbsoluteFile() method

BACK It appears that new File(this.getAbsolutePath()) should not be interpreted as being equivalent toinvoking getAbsoluteFile(). EXAMPLE PROGRAM import java.io.*; public class Program { public static void main(String[] args) { //...

Program is used to tests the existence of the file or directory defined by this abstract pathname. Boolean Exist()

BACK   The java.io.File.exists() method tests the existence of the file or directory defined by this abstract pathname. EXAMPLE PROGRAM import java.io.File; public class BooleanExistMethod { public static void main(String[] args)...

Program used to returns true object using Boolean equals(Object obj) method

BACK   The java.lang.Boolean.equals(Object obj) returns true if and only if the argument is not null and is a Boolean object that represents the same boolean value as this object. EXAMPLE PROGRAM public class BooleanEqualsbyObject...

Program is used to deletes the file or directory defined by the abstract path name using Void deleteOnExit()

BACK   The java.io.File.deleteOnExit() method deletes the file or directory defined by the abstract path name when the virtual machine terminates. Files or directories are deleted in the reverse order as they are registered. EXAMPLE PROGRAM import...

Program used to delete the files or directory using Boolean Delete() method

BACK   The java.io.File.delete() method deletes the file or directory defined by the abstract path name. To delete a directory, the directory must be empty. EXAMPLE PROGRAM import java.io.File; public class BooleanDelete { public...

Program for Creating StaticFile createTempFile(String prefix,String suffix,File directory)

BACK   The java.io.File.createTempFile(String prefix, String suffix, File directory)    method creates a new empty file in the specified directory. EXAMPLE PROGRAM import java.io.File; public class CreatTempFile { public...

The Collection Program sort the specified list according to the order induced by the specified comparator using sort(List list, Comparator c) method

BACK   The sort(List<T>,Comparator<? super T>) method is used to sort the specified list according to the order induced by the specified comparator.. Example Program import java.util.*; public class Comparator1 { static public...

The Collection Program Sorts the specified list into ascending order, according to the natural ordering of its elements using sort(List list)

BACK   Sorts the specified list into ascending order, according to the natural ordering of its elements. Example Program import java.util.*; public class Sort { public static void main(String[] args) { { List<String> col...

The Collection Program singletonMap used to get an immutable map, mapping only the specified key to the specified value using singletonMap(K, V) method

BACK   The singletonMap(K, V) method is used to get an immutable map, mapping only the specified key to the specified value. Example Program import java.util.*; public class Map1 { public static void main(String[] args) { Map<Integer,...

The Collection Program Silgleton Returns an immutable set containing only the specified object using singleton(T o) method

BACK   Returns an immutable set containing only the specified object. It restricts the instantiation of a class to one object. Example Program public class Singleton { private static Singleton sing = new Singleton(); /* * A...

The Collection Program Singleton used to return an immutable list containing only the specified object using SingletonList(T o) method

BACK   The singletonList(T) method is used to return an immutable list containing only the specified object. Example Program import java.util.*; public class List111 { public static void displayList(List<String> l) { Iterator<String>...

Get Filepath program to get the pathname of the file using getPath() method

BACK   Get Filepath program to get the pathname of the file using getPath() method EXAMPLE PROGRAM import java.io.File; public class StrFilepath { public static void main(String[] args) { File f = null; String v; boolean...

Get parent file program to get the name of parent file path using getParentFile() method

BACK   Get parent file program to get the name of parent file path using getParentFile() method EXAMPLE PROGRAM import java.io.File; public class ParentFilepath { public static void main(String[] args) { File f = null; File...

Get Parent program to find the parent Directory of the mentioned file using getParent() method.

BACK   Get Parent program to find the parent Directory of the mentioned file using getParent() method. EXAMPLE PROGRAM import java.io.File; public class GetParent { public static void main(String[] args) { File f = null; String...

String Getname program to get the name of the file or directory mentioned in pathname using getName() method.

BACK   String Getname program to get the name of the file or directory mentioned in pathname using getName() method. EXAMPLE PROGRAM import java.io.File; public class StrGetname { public static void main(String[] args) { File...

Get totalspace program to get size of a partition where abstract file exists using getTotalSpace() method.

BACK   Get totalspace program to get size of a partition where abstract file exists using getTotalSpace() method. EXAMPLE PROGRAM import java.io.File; public class TotalSpace { public static void main(String[] args) { File...

The unmodifiableSortedSet() method is used get an unmodifiable view of the specified sorted set.in ascending order using unmodifiableSortedSet(SortedSet s)

BACK   The unmodifiableSortedSet() method is used get an unmodifiable view of the specified sorted set.in ascending order Example Program import java.util.*; public class UnmodifySortedsetcltn { public static void main(String[]...

The unmodifiableSortedMap() method is used to return an unmodifiable view of the specified sorted map. in ascending order

BACK   The unmodifiableSortedMap() method is used to return an unmodifiable view of the specified sorted map. in ascending order Example Program import java.util.*; public class UnmodifiableSortedmapcltn { public static void main(String[]...

The unmodifiableSet() method Returns an unmodifiable view of the specified set in Descending order using unmodifiableSet(Set s)

BACK          The unmodifiableSet() method Returns an unmodifiable view of the specified set in Descending order Example Program import java.util.*; public class UnmodifiableSetclt { public static void main(String[] args)...