Pages

Saturday, January 10, 2015

Some java questions

1.

/*
 * prints output as
 *
 * Double array
 *
 */
public class NullCast {
public static void main(String args[]){
new NullCast().matchNull(null);
}
public void matchNull(Object obj){
System.out.println("Object");
}
public void matchNull(double[] obj){
System.out.println("Double array");
}
}


2.

import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/*
 * prints output as below
 *
 * list
 *
 */

public class MethodParameter {
public static void main(String args[]){
List<String> list = Arrays.asList(new String []{""});

new MethodParameter().method(list);

//error if list was declared as "List list = " i.e. (without generic type)
//method(Collection<Object>) is ambiguous for the type MethodParameter
}

public void method(Collection<Object> obj){
System.out.println("collection");
}
public void method(List<String> str){
System.out.println("list");
}
}

3.

/*
 * prints output as below
 *
 * woof woof
 *
 */
public class StaticMethods {
public static void main(String args[]){
Dog dog = new Dog();
Dog basenji = new Basenji();
dog.bark();
basenji.bark();
}
}
class Dog{
public static void bark(){
System.out.print(" woof ");
}
}
class Basenji extends Dog{
public static void bark(){

}
}

IT Training




One of the paid self-paced and instructor led training site. Specialized into Computer/IT related technolgoy training.


https://intellipaat.in/

Download videos from youtube, facebook




This is a great site if you want to download videos from youtube,facebook and other sites.

http://www.downvids.net/

Online WSDL Analyzer

Following is one of the best site if you are working on a WSDL.

I recently tested one of my wsdl and was able to remove lot of parsing errors.....

You would need to upload the WSDL file to the site for it to analyze.

https://www.wsdl-analyzer.com/