Top "Methods" questions

A method is a block of code that performs a task and is associated with a class or an object.

How can I create a Java method that accepts a variable number of arguments?

For example, Java's own String.format() supports a variable number of arguments. String.format("Hello %s! ABC %d!", "World", 123); //=> …

java function methods overloading
Passing just a type as a parameter in C#

Hypothetically it'd be handy for me to do this: foo.GetColumnValues(dm.mainColumn, int) foo.GetColumnValues(dm.mainColumn, string) where …

c# types methods parameters
Verify a method call using Moq

I am fairly new to unit testing in C# and learning to use Moq. Below is the class that I …

c# testing methods moq
Android ListView with onClick items

I'm a new programmer and new in Android. I'm using this example http://www.androidhive.info/2012/09/android-adding-search-functionality-to-listview/ and it works …

android listview methods android-activity elements
How to call a parent method from child class in javascript?

I've spent the last couple of hours trying to find a solution to my problem but it seems to be …

javascript oop methods parent
Why does Python code use len() function instead of a length method?

I know that python has a len() function that is used to determine the size of a string, but I …

python function oop methods string-length
What does the return keyword do in a void method in Java?

I'm looking at a path finding tutorial and I noticed a return statement inside a void method (class PathTest, line 126): …

java methods return void
Can overridden methods differ in return type?

Can overridden methods have different return types?

java methods overriding
Usage of @see in JavaDoc?

When do I use @see when dealing with JavaDocs? What is its usage? For example if MethodA calls MethodB then …

java methods javadoc
Java Inheritance - calling superclass method

Lets suppose I have the following two classes public class alpha { public alpha(){ //some logic } public void alphaMethod1(){ //some logic } } …

java inheritance methods superclass