Win a copy of Head First Android this week in the Android forum!

MuraliH Krishna

Greenhorn
+ Follow
since Jan 19, 2008
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 MuraliH Krishna

Hi ranchers,
Can any one advice me where can I find the _jsp.class file for a given .jsp file. Thanks in advance.

Murali.
13 years ago
JSP
Thanks Sagar for your reply, my requirement is without clicking the link i want to goto the tomcat manager page where all the projects are deployed. i.e if I hit http://localhost:8080/ I should land into that page. Can some one can help me please.
13 years ago
Hi ranchers,
I have a requirement to open the Tomcat Web Application Manager which has the list of all the projects deployed instead of the tomcat home page when ever i open the tomcat i.e when I use http://localhost:8080 in the browser. Can anyone of you help me. Thank you in advance.
13 years ago
Hi ranchers,
I work for a organisation which has a network with 500+ PC's running on windows. I have a need to develop a program in java which should send messages to others PC's using the default utilities like net send in dos. Is there a way where i could use net send message in dos using java. Or can any one suggest me any other alternative.Please help me. Very URGENT.

Thanks in advance.
13 years ago
Hai Ranchers,
I have a requirment of passing a resultset object to a function. When I try to access the resultset object in the receiving end, I am getting an error like closed resultset cannot be accessed. I can understand that we pass a reference to the calling function but is there a way to pass the resultset object and its data.Can some one help me please. its very urgent.
Dear Hasnain Javed Khan,
thanks for your help. its very clear now.
Thanks once again,
Murali
Hi Ranchers,
I have a doubt in generics of K&B book, in page 594 its says
"When you use the <? Super �> syntax, you are telling the compiler that you can accept the type on the right hand side of super or any of its supertypes, since � and this is the key part that makes it work- a collection declared as any supertype of dog will be able to accept a dog as an element. List<Object> can take dog. List<animal> can take a dog and List<dog> can take a dog. So passing any of those in will work. So the super keyword in wildcard notation lets you have a restricted , but still possible way to add to a colection".
the code I tried is
import java.util.*;
public class GenericTest1 {
public static void main(String[] args)
{
List<animals11> l = new ArrayList<animals11>();
l.add(new dog());
l.add(new dog());
l.add(new dog());
System.out.println(l.size());
GenericTest1 gt = new GenericTest1();
gt.addanimals(l);

}
public void addanimals(List<? super dog> l)
{
l.add(new animals11());
System.out.println(l.size());
}
}
class animals11
{
public void getMe()
{
System.out.println("from animals11");
}
}
class dog extends animals11
{
public void getMe()
{
System.out.println("from dog");
}
}
as per my understanding when i am able to add the super type of dog object when i use the <? super dog> i should be able to add the animals11 object as it is a superclass of dog, but why am i getting the error when i am trying to add in addanimals method???.can anyone please explain.
HI,
can any one kindly explain what is the mistake I am doing in the following code. Why it is not compiling.

import java.util.*;
public class CollectionTest1 {
public static void main(String[] a)
{
Set<animal> s = new HashSet<animal>();
s.add(new animal("aa"));
s.add(new animal("ab"));
s.add(new animal("ac"));
s.add(new animal("ad"));

animal[] ar = (animal[])s.toArray();
Collections.sort(s);

}

}

class animal implements Comparable<animal>
{
String i;
animal(String i)
{
this.i = i;
}
public String getI()
{
return i;
}
public int compareTo(animal a1) {
return i.compareTo(a1.getI());
}
}

Thanks in advance.
hi patricia,
can you please explain what you have understood. after running the program the output i am getting is 210210-1. the code i compiled is

public class AssertTest2 {
void m1(int i)
{
int j = i % 3;
switch (j)
{
case 0: System.out.print("0"); break;
case 1: System.out.print("1"); break;
default: assert j==2; System.out.print(j);
}
}
public static void main (String[] args) {
AssertTest2 a = new AssertTest2();
for (int i=5; i >= -1; i--) {a.m1(i);}
}}

Thanks.
Murali