Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Java General Java Passing variables into methods Tutorial

If the variable passed is a primitive, only a copy of the variable is actually passed to the method. So modifying the variable within the method has no effect on the actual variable.

Tutorial Details:

Java Passing variables into methods

If the variable passed is a primitive, only a copy of the variable is actually passed to the method. So modifying the variable within the method has no effect on the actual variable.

When you pass an object variable into a method, a copy of the reference variable is actually passed. In this case, both variables refer to the same object. If the object is modified inside the method, the change is visible in the original variable also.

Though the called method can change the object referred by the variable passed, it cannot change the actual variable in the calling method. In other words, you cannot reassign the original reference variable to some other value.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Java General Java Passing variables into methods Tutorial

View Tutorial:
Java General Java Passing variables into methods Tutorial

Related Tutorials:

Java Q&A - Java Still Open
Java Q&A - Java Still Open
 
Java Tip 68: Learn how to implement the Command pattern in Java - JavaWorld - February 1999
Java Tip 68: Learn how to implement the Command pattern in Java - JavaWorld - February 1999
 
Smarter Java development - JavaWorld August 1999
Smarter Java development - JavaWorld August 1999
 
Smart object-management saves the day - JavaWorld November 1999
Smart object-management saves the day - JavaWorld November 1999
 
XSL gives your XML some style - JavaWorld June 2000
XSL gives your XML some style - JavaWorld June 2000
 
Master Java with these introductory books - JavaWorld May 2001
Master Java with these introductory books - JavaWorld May 2001
 
JSP best practices
Follow these tips for reusable and easily maintainable JavaServer Pages
 
A good article/untrapment about Runtime.exec
A good article/untrapment about Runtime.exec
 
Profiling CPU usage from within a Java application
Profiling CPU usage from within a Java application
 
Servlet 2.4: What's in store
Servlet 2.4: What's in store
 
The Java Web Services Tutorial
This tutorial is a beginner\'s guide to developing Web services and Web applications using the Java Web Services Developer Pack (Java WSDP).
 
Learn to speak Jamaican
Introducing Jamaica, a JVM macro assembler language Most Java programmers, at one time or another, have wondered how the JVM works. Java bytecode programming reveals much insight into the JVM and helps developers program Java better. Also, the ability t
 
Jython
Get to know Jython, in this first article in a new series introducing alternate languages for the Java Runtime Environment, alt.lang.jre. Jython is an implementation of the popular scripting language Python, but running on a JVM. For Python developers Jyt
 
The JDBC RowSet Implementations Tutorial
In "The JDBC RowSet Implementations Tutorial," you will look at how to use the standard JDBC RowSet implementations specified in JSR-114.
 
Servlet Essentials
This document explains the concepts of Java Servlets and provides a step-by-step tutorial for writing HTTP Servlets with complete source code for the example Servlets. The tutorial and the other chapters cover all facets of Servlet programming from a ...
 
The JavaTM Web Services Tutorial
A beginner's guide to developing Web services and Web applications on the Java Web Services Developer Pack
 
JSP Tutorial
This Tutorial is for beginners in the Java Server Pages Technology
 
JavaServer Pages Technology - Documentation
Sun's tutorial for Java Server Pages that provide a good introduction to design web pages with JSP.
 
Generating an XML Document with JAXB
In this tutorial, JAXB is used to generate Java classes from an XML Schema. An example XML document shall be created from the Java classes.
 
Developing Distributed application using Enterprise Java Beans, J2EE Architecture, EJB Tutorial, WebLogic Tutorial.
Developing Distributed application using Enterprise Java Beans, J2EE Architecture, EJB Tutorial, WebLogic Tutorial. Distributed Architecture Two-tier application: In the past two-tier applications were used. Two-tier applications are also know as
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.