public static void main(String[] args) { int num = 10; foo(num); System.out.println(num); String num1 = "10"; foo(num1); System.out.println(num1); StringBuilder sb = new StringBuilder("iphone"); foo(sb); System.out.println(sb); StringBuilder sb1 = new StringBuilder("iphone"); foo1(sb1); System.out.println(sb1); } static void foo(int value) { value = 100; } static void foo(String text) { text = "windows"; } static void foo(StringBuilder builder) { builder.append("4"); } static void foo1(StringBuilder builder) { builder = new StringBuilder("ipad"); }