Hi Experts,
I have question on the bellow program (runs perfectly),
1. As I have created an instance (object) of startup class and we dint called method paint from the main method using the object but still it is called (how?). But in case of Instantiable classes, we need to call any method explicitly using the created object.
2. Is there any standard sheet to do rough calculation of frame locations? It is bit confusing, because my window resolution is 1024*768 and my frame size is differs. Whatever location measurement we do with frames: Is it depends on Window resolution or Frame resolution?
Thanks in advance for any help!
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.Properties;
import java.io.File;
import java.util.Enumeration;
import java.util.Set;
public class TestSheet
{
public static void main(String args[]) throws Exception
{
File f = new File("F://my study material//DemoFiles//DemoTXT.txt");
FileOutputStream fout = new FileOutputStream("F://my study material//DemoFiles//DemoTXT2.txt", true);
FileInputStream fis = new FileInputStream(f);
Properties p = new Properties();
p.load(fis);
Enumeration e = p.propertyNames();
while(e.hasMoreElements())
{
String key = (String)e.nextElement();
System.out.println(key + " : \t" + p.getProperty(key));
}
p.store(fout, "no comment");
System.out.println();
Set subject = p.keySet();
for(Object name: subject)
System.out.println(name+" : "+p.getProperty((String)name));
String str = p.getProperty("Social Science", "No record");
System.out.println("Marks obtain by social science: "+str);
}
}
Jiten