I have two pieces of code
1. public class Stringmethods {
public void testmethod()
{
String s="airplane";
System.out.println("Number of exceptions thrown rows:");
}
}
2. public class Stringmethods {
public void testmethod()
{
String s="airplane";
}
System.out.println("Number of exceptions thrown rows:");
}
the second one (2)doesnt work. Can any body answer why it is working when we keep it in a method and why not when it is in a class
Oracle Certified Enterprise Architect (Part 1);SUN Certified Programmer;SUN Certified Business Component Developer;SUN Certified Web Component Developer;
Oracle Certified WebServices Developer;Oracle Certified Java Persistence API Developer;Oracle Certified SQL Expert;IBM Certified XML Solution Developer