Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Method call  RSS feed

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 9462
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you try it and let us know what you find out?
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!