Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes Method call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Method call" Watch "Method call" New topic
Author

Method call

Rashmi Dupati
Greenhorn

Joined: Mar 05, 2007
Posts: 22
Hello all

Can we pass null parameter to a meathod?

test(null);

like this for the method

public static void test(String str){
//some code goes here
}

Thanks in advance

Regards
Rashmi
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

Why don't you try it and let us know what you find out?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Method call
 
Similar Threads
Doubt in Effective Java
NullPointer Exception
subclass member method called in superclass constructor
OOP-2 Exception question
compareTo with null Date object