James Jiang

Greenhorn
+ Follow
since Dec 13, 2007
Merit badge: grant badges
For More
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 James Jiang

Problem solved, thank you Campbell.
15 years ago
Hey:
I got an error: java.util.regex.PatternSyntaxException: Unexpected internal error near index 1 when i run the codes below:
public void testGetResult(){
String pattern="\\";
String target="james\\jiang";
//getResult(target,pattern) calls String.split(pattern) and returns
//the first element of the string array.
String result=StringPattern.getResult(target,pattern);
assertEquals("james",result);
}
what's wrong with pattern:"\\".Thanks for your patience.
15 years ago
Yes,Rob.It is more reasonable in your way. I learn it.
15 years ago
you also make class ButtonTest implement java.awt.event.ActionListener to get it working.
15 years ago
You can go throuigh the log files and look for error messages then locate it.
15 years ago
I think the third parameter is useful when you need to write the information into several log files,notice that the first parameter is a pattern of string,you can specify many log files like 1.log,2.log,3.log and so on.
15 years ago
Hey,venkata satya:
you can do it like this:
BufferedReader br=new BufferedReader(new InputStreamReader(generatedInputStream));
String s=br.readLine();
i wish it helps you.
15 years ago
You need to write a separate module that lists all the details about your project and you can see http://java.sun.com/products/javahelp/download_binary.html for help
15 years ago
well, suppose someday in the future, it needs many taks such as database querying during creating a object of the class, how should you do, if you
write these codes in constructor, it may seem less elegant and break the encapsulation and division rules of oop.So you need to put these details into the methods in factory class. And this ensures the oo rule: separate mutable parts from stable rule.
At the same time,it gives you flexibility in your design: you can add or remove subclasses in the factory class without changing the client codes who invoke your codes.
Am i clear.
agree. I can still learn something from them,however. Thank you for all your replies.
15 years ago
oh, it sounds interesting. I am on windows 2003 and it works.
15 years ago
Hi,dav mrazek
I don't have commons-dbcp-1.2.2.jar file, so
I change two statements :cl.addFile("C:\\log4j.jar");
Class c = cl.loadClass("org.apache.log4j.Appender");
and execute the program, it works. You can check if commons-dbcp-1.2.2.jar
exists in your c disk.
15 years ago