You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by satyanarayana <gs...@gmail.com> on 2006/11/16 05:49:24 UTC
Re: Double log4j.jar file causing
Borg <jadt <at> morebv.com> writes:
> Abhay,
> Did you ever find a resolution to this problem. I am having the same issue.
>
> --Thanks
>
1. Read a properties file containing list of usernames and passwords as
key=value
format. Accept a username from stdin and print the corresponding password.
Pick the properties file from classpath. Look at Class.getResourceAsStream()
API
2. Write a Java class to satisfy following conditions
Class Key {
private int i;
private String s;
public Key(int i, String s) {
this.i = i;
this.s = s;
}
// Your other code
}
Above class should satisfy following code
HashTable ht = new HashTable();
ht.put(new Key(10, "I am 10"), "Value Of 10");
// Statement below should print "I am 10"
System.out.println(ht.get(new Key(10, "I am 10"));
3. Ask the user to enter the path of a zip file and unzip that file at a
location given by user. Refer java.util.jar package
4. Write a function to print the given amount in words. Assume a maximum
value of 9999 for the parameter.
Example 1: printInWords(257) should print following line
Two Hundred and Fifty Seven
Example 2: printInWords(1001) should print following line
One thousand and one
Example 3: printInWords(1291) should print following line
One thousand two handred and ninty one
5. Read a file and sort the lines of that file using following criteria
a. String comparision
b. Length of line
c. Second word of the line
Accept search criteria as command line argument of your main method
Use ArrayList to store the lines and use comparator
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org