Java examples for Object Oriented Design:Field
Variables Name Hiding
public class Main { int num = 2017; // An instance variable void printNum(int num) { System.out.println("Parameter num: " + num); System.out.println("Instance variable num: " + num); }/*from w w w . ja v a 2 s. com*/ public static void main(String[] args) { Main a = new Main(); a.printNum(2000); } }