Top "Methods" questions

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

Naming conventions for Java methods that return boolean

I like using question mark at the end of method/function names in other languages. Java doesn't let me do …

java methods naming-conventions
Java synchronized static methods: lock on object or class

The Java documentation says: It is not possible for two invocations of synchronized methods on the same object to interleave. …

java class static methods synchronized
How do I pass multiple arguments to a ruby method as an array?

I have a method in a rails helper file like this def table_for(collection, *args) options = args.extract_options! ... …

ruby-on-rails ruby arrays methods arguments
How do I invoke a method with array parameter in java?

I have an assignment in which I have to perform operations on array in Java, I have to make separate …

java arrays methods invocation
ReactJS - Call One Component Method From Another Component

I have two components. I want to call a method of the first component from the second component. How can …

reactjs class methods call
Method Syntax in Objective-C

Can someone explain this method declaration syntax for me? In this function, the number of rows of a UIPickerView (slot …

objective-c syntax methods
How to check whether a method exists in Python?

In the function __getattr__(), if a referred variable is not found then it gives an error. How can I check …

python methods
Why do you need explicitly have the "self" argument in a Python method?

When defining a method on a class in Python, it looks something like this: class MyClass(object): def __init__(self, …

python oop methods self
Can a C++ enum class have methods?

I have an enum class with two values, and I want to create a method which receives a value and …

c++ methods enums
Finding # occurrences of a character in a string in Ruby

I'm looking for the Ruby method (1.9...) that can help me find the number of occurrences of a character in a …

ruby string methods