[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Kamesh Loganathan:
Hi Pal,
I think u should use c:remove tag which belongs to the core
taglib of JSTL. Writing java code in JSP's is unacceptable.
look at http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html
Originally posted by Rob Clark:
It was the JDK I was using. It seems to work properly, now. Thank you very much for your assistance.
Andrew Kenyon wrote:Hello All!
The errors I get back from the compiler are:
ArrayListMagnet.java:32: illegal start of expression
public static void printAL(ArrayList<String> al) { //method to print AL state
^
ArrayListMagnet.java:32: illegal start of expression
public static void printAL(ArrayList<String> al) { //method to print AL state
^
ArrayListMagnet.java:32: ';' expected
public static void printAL(ArrayList<String> al) { //method to print AL state
^
ArrayListMagnet.java:32: ';' expected
public static void printAL(ArrayList<String> al) { //method to print AL state
Piyush
Andrew Kenyon wrote:Thank you for the quick reply. I should have mentioned in my original post that I had tried that, thinking that maybe the book really was right, lol. Still, with the "} // close main" removed, the program still won't compile. Below are the error messages:
ArrayListMagnet.java:32: illegal start of expression
public static void printAL(ArrayList<String> al) { //method to print AL state
^
ArrayListMagnet.java:32: illegal start of expression
public static void printAL(ArrayList<String> al) { //method to print AL state
^
ArrayListMagnet.java:32: ';' expected
public static void printAL(ArrayList<String> al) { //method to print AL state
^
ArrayListMagnet.java:32: ';' expected
public static void printAL(ArrayList<String> al) { //method to print AL state
^
ArrayListMagnet.java:41: reached end of file while parsing
} // close class
^
5 errors
Illegal start of the expression? Is there something different between when the book was written and the version of Java I'm using? Maybe some weird difference because I'm using Open JDK? Or is it another syntax error on my part?
Piyush
Piyush Joshi wrote:
2. even if you remove error 1 there is one more error: you can not call printAL() from main() because printAL() is non-static, and you can not call non-static members form static main() method. To correct this you should make printAL() static
Andrew Kenyon wrote:
Aha! You, sir, are a genius. Or at least very helpful!
Piyush