suresh pilakal babu

Ranch Hand
+ Follow
since Jul 01, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by suresh pilakal babu


I have added below code in pom.xml to change report output directory
But still test report is generated in target/surefire-reports directory

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>2.0-beta-5</version>
<configuration>
<outputDirectory>target/newsite</outputDirectory>
</configuration>
</plugin>

what is wrong?Help me

15 years ago
How to use dependsONMethods in testNG with Maven.Any example code please
15 years ago
import java.util.*;
class Gen68
{
public static void main(String[] args)
{
ArrayList arl = new ArrayList();
//arl.add("test"); --------line #1
}
}

Why the compiler is not warning us about the typw safety here?
It warns only when we add something to arraylist(--------line #1)
import java.util.*;
class Gen67
{
public static void main(String[] args)
{
List lstNonTypeSafe = new ArrayList();
lstNonTypeSafe.add(new String("this is String"));
lstNonTypeSafe.add(new Integer(2));

List<String> lstTypeSafe = new ArrayList<String>();
lstTypeSafe = lstNonTypeSafe; ------#Line 1
System.out.println(lstTypeSafe.get(1));
}
}

Since I am not geting compile error at #Line 1, I can not tell Generics 100% perfect for avoiding runtime exception. Am I right?.Let me know your thought.

Thanks,
Suresh.
Hello

I want to execute a query, which contains tables from different database schema.
How can i create a single connection object for different schemas.I am using oracle database.
Is it possible?


Thanks,
Suresh.
var url="getuser.jsp" --------1
url=url+"?emp_id="+emp_value---------2

xmlHttp.onreadystatechange=stateChanged ----3
xmlHttp.open("GET",url,true)------4
xmlHttp.send(null)----5

could you please line #4 and #5;
In #4 what is the use of 3rd parameter(true)?
In #5 why sending null value?
Hi,

Can I implement AJAX functionality without using struts?

Thanks,
Suresh.
How to load JNI library?
interface I{}
class A {}
class D{}

class InstOfTest{
public static void main(String args[]){

Boolean b;
b = new A() instanceof I ;

b = new A() instanceof D ;

}
}

In above code class A is not implemented Interface I.

But the statement
b = new A() instanceof I
is not generating compilation error


But the code
b = new A() instanceof D ;

is generating error.why?
I hava a java project
It containing the folder structure
Common_java -> com -> org -> util ->Connstants.java
In Constants.java
package com.org.util;
showing error.(package path error..)

But when i modify to

package Common_java.com.org.util;

no error!!!.

i want to use package com.org.util; instead of package Common_java.com.org.util;

How can possible?
16 years ago
new Letter<B>().getApplication(new Letter<C>());

Hoe the test "E extends B" will pass here?

Here E is B, then it will become "B extends B".
"B extends B" is cyclic inheritance .right?
Ankit,

According to you below code should produce Compiler warning and Classcast Exception

Vector<Integer> v = new Vector();
v.add(10);
Integer i = v.get(0);

I am geting compiler warning but its executing fine ..no classcast exception
[ November 08, 2008: Message edited by: suresh pilakal babu ]
I know the statment

Vector<Integer> v = new Vector();

will give warning message(not type safe operation)

Marc.. this is the only difference?

I don't think so..anybody else can answer it..?
What is the use of specifying <Integer> after = .

Vector v = new Vector<Integer>();

I mean both
Vector<Integer> v = new Vector<Integer>();
and
Vector<Integer> v = new Vector();
are same?


Thanks
Suresh
Consider the problem of writing a routine that prints out all the elements in a collection. Here's how you might write it in an older version of the language (i.e., a pre-5.0 release):

void printCollection(Collection c) {
Iterator i = c.iterator();
for (k = 0; k < c.size(); k++) {
System.out.println(i.next());
}
}

And here is a naive attempt at writing it using generics (and the new for loop syntax):

void printCollection(Collection<Object> c) {
for (Object e : c) {
System.out.println(e);
}
}

The problem is that this new version is much less useful than the old one. Whereas the old code could be called with any kind of collection as a parameter, the new code only takes Collection<Object>, which, as we've just demonstrated, is not a supertype of all kinds of collections!
So what is the supertype of all kinds of collections? It's written Collection<?> (pronounced "collection of unknown"), that is, a collection whose element type matches anything. It's called a wildcard type for obvious reasons. We can write:

void printCollection(Collection<?> c) {
for (Object e : c) {
System.out.println(e);
}
}