public class Test {
public static void main(String[] args){
Test1 s;
try
{
s = new Test1();
}
catch(Exception e)
{
System.out.println("*********");
}
if( s == null )
System.out.println("******s is null");
else
System.out.println("*******s is not null");
}
}
public static void main(String[] args){
Test1 s;
try
{
s = new Test1();
}
catch(Exception e)
{
System.out.println("*********");
}
if( s == null )
System.out.println("******s is null");
else
System.out.println("*******s is not null");
}
}
Test.java:19: variable s might not have been initialized
if( s == null )
^
1 error
public class Test {
public static void main(String[] args){
Test1 s=null;
try
{
s = new Test1();
}
catch(Exception e)
{
System.out.println("*********");
}
if( s == null )
System.out.println("******s is null");
else
System.out.println("*******s is not null");
}
}