Saturday, August 8, 2015

How to change the user agent manually in firefox ?

The User Agent Switcher extension adds a menu inside Tools option of the toolbar menu to switch the user agent of a browser. The extension is available for Firefox and will run on any platform i.e. this browser supports including Windows, OS X, Linux and Mac. 

Please find the link below to download the user agent switcher-
user-agent-switcher

How to use- After changing the user agent, reload the page or open the url in new tab.

Saturday, November 22, 2014

Day9 (Java Tutorial)...topis- method overloading.

Please continue from here-
http://selenium-makeiteasy.blogspot.in/2014/11/day8-java-tutorialtopis-this-keyword.html

*Method Overloading
        developing the same method with different argument list is called as method overloading. The argument list should differ in either of below 3 ways-
  • Type of arguments should be different.
  • Number of argument should be different.
  • Position of arg should be different.
ex-
 class="prettyprint prettyprinted"
public class Demo {
    public static void main(String[] args) {
        System.out.println("program starts");
        add(5, 10);//this will call add(int a, int b)
        add(4.6, 10); //this will call add(double a, int b)
        System.out.println("Program ends.");
    }
    public static void add(int a, int b){
        System.out.println("add(int a, int b)");
    }
    public static void add(double a, int b){
        System.out.println("add(double a, int b)");
    }
}

output
---------
program starts
add(int a, int b)
add(double a, int b)
Program ends.

Note-


  •  Inside a class, both static method as well as non-static method can be overloaded.
  • In java, methods can not be overloaded by giving different return type.
  • java identify the overloaded method based on the arguments, it does not identify based on the return type nor 'static' keyword.
  • There can't be two methods with the same method signature inside a class.