santhosh.R gowda wrote:
Please read this carefully
want to know the method like that takes all primitive values as parameter
You really need to work on your communication skills.
Like Campbell said, your original post is very confusing.
Nitish posted a probable solution based on what he could make of it. He was also kind enough to ask you, if he understood your problem correctly.
If it was clear he you had not managed to convey the meaning properly, re-quoting your original post hardly helps clear out the meaning does it?
Also, "please read this carefully" implies that the fault is on Nitish's part, of giving your post a cursory glance, which is not the case.
Please make sure people understand your posts and are not offended.
Ya i agree with you but taking as Object as a parameter will convert primitive to object .
i want exactly like this in primitive
Nope. Won't work. There is no option to have a single method take multiple primative types -- as primatives. If you want to provide this option to your callers, you have to do some work -- either create a bunch of overloaded methods, or type and unbox the object back to primative. There is nothing in the current specification that will allow you to do it without doing some work.
As examples, (1) take a look at the printstream println() methods to see a bunch of overload methods, or (2) take a look at the printf() method to see the autoboxing option. Both provide the "feel" of a single method taking any primatives.