File not found exception in java even though file exists in src folder, src folder has 2 files kaif.xml and PropertiesDemo.java
FilePath: C:\Users\sam\Desktop\javatest\Java\BasicJava\PropertiesDemo_loadFromXML_App\PropertiesDemo\src\kaif.xml
PropertiesDemo.java
class PropertiesDemo
{
public static void main(String[] args) throws IOException
{
Properties p = new Properties();
try (FileInputStream fis = new FileInputStream("kaif.xml"))
{
p.loadFromXML(fis);
Enumeration<?> enumeration = p.propertyNames();
while (enumeration.hasMoreElements())
{
String key = (String) enumeration.nextElement();
String value = p.getProperty(key);
System.out.println(key + " = " + value);
}
}
}
}