Hi i have encounter this problem when i compile my java file
This is my test.java
public class test
{
private String s1= "Happy", s2= "Happy2", s3, s4;
private String i,toy,castille;
public test()
{
System.out.println("Inside Bath");
}
public String toString()
{
if(s4 == null) // Delayed initialization:
s4 = "Joy";
return
"s1 = " + s1 + "\n" +
"s2 = " + s2 + "\n" +
"s3 = " + s3 + "\n" +
"s4 = " + s4 + "\n" +
"i = " + i + "\n" +
"toy = " + toy + "\n" +
"castille = " + castille;
}
public static void main(String[] args)
{
test b = new test();
System.out.println(b);
}
}
Error i received was:
C:\>javac test.java
test.java:1: error while writing test: test.class (Access is denied)
public class test
^
1 error
What is the problem with the code?
Thanks