New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Passing values - Java


Posted Date:     Total Responses: 0    Posted By: Annapurna   Member Level: Gold   Points/Cash: 1   


public class PassingValue {
static int i = 0 ;
void increase (int i) {
++i;
}
void increase(PassingValue p)
{
System.out.println ("p.i in method " +p.i) ;
++p.i;
}

public static void main(String args [ ] ) {
PassingValue p = new PassingValue () ;
p.increase (i) ; // It can't change the i value.

System.out.println (i) ;

p.increase(p); //It can change the i value.
System.out.println ("p.i" +i) ;
}
}


Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: Example program for Null Pointer Exception - Java
Previous Project: Example of Initialization - Java

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.