Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Java's Constructors and Functions...
Closed Thread
Old 04-30-2006, 04:41 AM   #1 (permalink)
 
Newb Techie

Join Date: Apr 2006

Posts: 19

himalya

Default Java's Constructors and Functions...

Can you pls guide me through these terms in Java..
1.Implicit & Exlicit call constructors.
2.Pure and Impure Functions.

Is there a diff between call by value and pass by value.
I think that in terms of the taking method it is calling and if we take in terms of giving it is passing...Am I right??

same goes for call by reference and pass by reference..

PLS::I AM NOT ASKING DIFF BETWEEN CALL BY VALUE AND CALL BY REFERENCE same for PASS BY VALUE AND PASS BY REFERENCE.
himalya is offline  
Old 04-30-2006, 01:36 PM   #2 (permalink)
 
Software Developer

Join Date: Mar 2006

Location: Columbus, OH

Posts: 569

jaeusm is on a distinguished road

Default

Technically, you only pass by value or reference, not call. The caller doesn't get to choose value or reference, that's decided by the passer. In Java, you don't really get to choose at all. All objects are passed by reference, while primitives are passed by value. (If you want to get really technical -- and most people don't on this issue -- from a compiler writer's perspective, Java is strictly pass by value. Objects actually aren't passed by reference, references to objects are passed by value.)

Pure functions don't modify their arguments or output anything. The result of a pure function call is the return value.

When you call the constructor of a subclass, if you don't explicitly call the base class constructor, the JVM will automatically (implicitly) call the parameterless base class constructor. Obviously, if no parameterless base class constructor exists, you have a problem.
jaeusm is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On