Questions tagged [method-parameters]
The method-parameters tag has no usage guidance.
method-parameters
66
questions
1
vote
0
answers
25
views
aliasing String arguments and parameters for methods in Java [duplicate]
I know that when you pass an object in as an argument to a method, the formal parameter object in that method becomes an alias of the argument/actual parameter. Unless that's actaully wrong, I don't ...
0
votes
2
answers
820
views
Update customfield in JIRA using REST API without CURL
I am new to working with PowerShell and trying to use JIRA's Rest API (without cURL-command) to update certain custom field like "Description".
But I can not get the right way.
Below is my ...
0
votes
1
answer
989
views
C# What is the best practice to pass a parameter as method argument to both get AND set data from a generic class
I'm fairly new to extension methods and i was wanting to make something very generic to re-order any type of list of an Entity Framework DbSet<TEntity>. To do so, i'd need to precise what ...
0
votes
1
answer
563
views
why I can't return anonymous type as generic in C#, while I can do the same for method parameters?
Consider this code:
using System;
class EntryPoint{
static void Main(){
f(new{ Name = "amir", Age = 24 });
}
static void f <T> (T arg){}
}
This code compiles ...
0
votes
2
answers
226
views
Use initializer list as default value for function/method parameter
I want to do something like
void A (int a[2] = {0,0}) {}
but I get
<source>(1): error C2440: 'default argument': cannot convert from 'initializer list' to 'int []'
<source>(1): note: The ...
0
votes
0
answers
197
views
Can I put 3 dots with Map into method parameter like this: private Map addAllMood(Map... map)
I am dealing with ellipsis (...) in method parameters in java.
The situation is as follows: I fill a Map and do calculations with it, as shown in the code below, but there is 1 method (addAllMood) ...
0
votes
1
answer
410
views
Passing type as a parameter [duplicate]
I have a method which takes an object of a certain inherited type and searches for it in the internal data structure...
public (bool,Point) GetItemPosition(IMyBaseType type)
{
...
}
So the use of ...
1
vote
1
answer
115
views
Read list of type parameter values using Scanner.nextX that matches the type parameter
There are so many posts related to this one that I don't think it would be helpful to reference them, but if people find particularly useful ones it would be great to have them added here.
ArrayList&...
1
vote
1
answer
441
views
Powershell function call changing passed string into int
So I am using the kind of buggy Sapien powershell studio to make a powershell driven GUI application, and I am attempting to perform an ADSI query.
$nameOfDeviceInput is a System.Windows.Forms.TextBox
...
-1
votes
1
answer
443
views
C# - Class property as a method of variable numer of parameters [closed]
I have the following class
public class MyClass
{
public int ElementId {get; set;}
public int? LowerBoundary {get; set;}
public int? UpperBoundary {get; set;}
public int SpecificMethod() {}
...
0
votes
3
answers
149
views
Difference between a method called with a parameter and a method called with none
please what's the difference between a method called with a parameter and one called with no parameter example:
state is! LoginInProgress ? _onLoginButtonPressed : null,
and:
state is! ...
-1
votes
2
answers
3k
views
Unused method parameters should be removed (squid:S1172) false positive using lambda
I have a working method that uses parameter as a lambda expression
private BiConsumer<List<String>, Properties> handleList(Properties p) {
return (list, prop) -> executeSubList(...
0
votes
1
answer
179
views
Invoke a matlab method in C# code with parameters
I am trying to invoke a matlab method in my C# code with parameters. I used reflection to load a dll with the matlab funcion at runtime into my application, which works fine:
Assembly matlabAssembly =...
0
votes
2
answers
45
views
How to set an element in an array as a method parameter?
I've an array that consists of many objects (called drops) and another separate object (called greenDrop). I would like to compare 2 objects at one time, one from the array & the other will be the ...
9
votes
2
answers
13k
views
Is mutating object-parameters in a method(in Java) a bad practice?
I have a question about mutating method-paramaters(which are objects) in a method.
I read and heard multiple times that it is a bad practice to mutate a object in a method which was passed in as a ...