View RSS Feed

Recent Blogs Posts

  1. Passing Primitive Data Type Arguments

    by , 04-26-2012 at 06:21 PM
    Primitive arguments for example, a double or an int, get passed by value into methods. This shows that changes to parameter values are present just in the methodís scope. When methods are returned it means that parameters have been gone & all alterations have been lost. For example:
    Java Code:
    public class PassPrimitiveByValue {
        public static void main(String[] args) {
            int x = 3;
            // invoke passMethod()