This post is for student who study java and they need many programs
in their exam and test so I am trying to make some java programs which help
them to make their work easy
Question : Write a program which accept input of full path of a file
and produce following output?
Input : C:/Users/Public/Pictures/SamplePictures/Desert.jpg
Output :
Extension : jpg
File Name : Desert
Path : C:/Users/Public/Pictures/SamplePictures
Solution :
import java.util.*;
public class Main
{
public static void main(String[] args)
{
String str;
Scanner sc=new Scanner(System.in);
System.out.print("Enter your name>> ");
str=sc.nextLine();