Louie Cheung

Greenhorn
+ Follow
since Dec 25, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Louie Cheung

this code simply takes 2 integer from user and write them on file, but the output file becomes rubbish such as:
how do i fix this? thanks


[edit]Add code tags. CR[/edit]
[ November 17, 2008: Message edited by: Campbell Ritchie ]
13 years ago
it was harder than i thought, a few questions weren't covered in HFSJ but nonetheless a great book!
im glad i cleared it with 81%
HFSJ and whizlabs was all i used
now wheres a good place to find a job as java developer in toronto?
and whats my salary expectation (i have no job experience)?
thank you all cheers!
14 years ago
i found the typo thanks a bunch guys
how do i view web.xml in explorer?
i tried
http://localhost:8080/listenerTest/WEB-INF/web.xml
and
http://localhost:8080/listenerTest/web.xml
both didn't work

and how do i view log?
sorry i'm completely new to this, thanks
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation+"http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<servlet>
<servlet-name>ListenerTester</servlet-name>
<servlet-class>com.example.ListenerTester</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ListenerTester</servlet-name>
<url-pattern>/ListenTest.do</url-pattern>
</servlet-mapping>

<context-param>
<param-name>breed</param-name>
<param-value>Great Dane</param-value>
</context-param>

<listener>
<listener-class>
com.example.MyServletContextListener
</listener-class>
</listener>

</web-app>
http://localhost:8080/listenerTest/ListenTest.do
this is the error i got in the browser:

HTTP Status 404 - /listenerTest/ListenTest.do
type Status report
message /listenerTest/ListenTest.do
description The requested resource (/listenerTest/ListenTest.do) is not available.

---------

i compiled the three classes Dog.java, ListenerTester.java, MyServletContextListener.java successfully under C:/Tomcat5/webapps/listenerTest/WEB-INF/classes/com/example
and also web.xml under WEB-INF

what seems to be the problem?
what makes it worth it to learn Tomcat 6 when you already know Tomcat 5, what are the major benifits?
14 years ago
would like to thank everyone on ranch who helped
not a great score but im proud i made it all by myself
a tip for everyone taking the test
java ranch, kathy book and whizlabs is all you need
14 years ago
this piece of code is from whizlabs 5.0, i want to know if the real exam requires knowledge of the FilenameFilter Interface or the listFiles method in the File class? i've noticed quite a few questions in whizlabs that require knowledge not talked about in the K.S book, should i waste time studying them or has the K.S book covered everything i need to know for the exam? please advice thanks

Originally posted by Burkhard Hassel:
Louie Cheung tried

super...

Bu.



yes i tried, and super too Burkhard Hassel
thanks
i tried to change the return type to <? extends TestArrayList> but still i get compiler error like this:

java.util.ArrayList<capture of ? super TestArrayList>
output = processList(output);
^

why? i know changing the parameter to <TestArrayList> would work but i want to know how the wildcard works here, thanks a bunch
i wrote this code myself and i couldn't get it to compile with the <? super TestArrayList> method argument type, <? extends TestArrayList> doesn't work either is it because im adding to the list inside the method?, it seems that the problem is from the return type? please advice


indenting repaired by Bu.
[ September 03, 2007: Message edited by: Burkhard Hassel ]

Originally posted by Giovanni Murguia:
Hello!

You could try something like:


Giovanni



i'm getting compiler error for the above code as follows:

cannot find symbol
symbol : method setCharAt(int, int)
location: class java.lang.StringBuffer
sb.setCharAt(0, letter+1);

i tested if i change it to the following it compiles fine:
sb.setCharAt(0, letter);

so what's wrong with the +1 there?