Questions tagged [method-call]

386 questions
0
votes
2 answers

Button event that calls method does not affect public int

This is my first question here and, although it's probably a very nooby one, it's had me stumped for quite a while. I'm using a simplified example to explain. On a Console Application, I have a public int 'x' set to 0 and a method 'test' which…
Sammmm
  • 11
  • 1
0
votes
0 answers

Safeguarding method parameters in java

I want to safe guard my method parameters that were passed to the called method from being changed accidentally. I know that we can use final keyword to achieve this (partially) like the following in the method signature. public void…
HJK
  • 1,382
  • 2
  • 9
  • 19
0
votes
8 answers

Get two results from another method in the the main application class using c#

I am trying to write a c# code by which I want to get a image from web api and the title of the image from the api. I implemented a method named GetImage and try to return two results (image and title) from it. However I wrote a code but as I am new…
Nowshin
  • 67
  • 1
  • 2
  • 11
0
votes
5 answers

The fastest way to call a method

Reading this article I found several ways to call a method. Method to call: public static void SendData(string value) { } Calls: delegate void MyDelegate(string value); //Slow method - NOT RECOMMENDED IN PRODUCTION! SendData("Update"); //…
abatishchev
  • 98,240
  • 88
  • 296
  • 433
0
votes
1 answer

Call a method without a reference to it from a separate jar library

I am writing a library in Java. A object in the library is referenced by the main application. The application requires a method to be called at a certain point on one of its objects. The library object wants to invoke this method in the…
perkss
  • 1,037
  • 1
  • 11
  • 37
0
votes
0 answers

Invoking method having attribute passed specific string data without reflection

I need to call method having a specific attribute passed some string data. For the setup below, how can you call(invoke) method having attribute parameter of "Call this method" without using reflection ? By the way I use ninject as IoC. public…
serefbilge
  • 1,654
  • 4
  • 29
  • 55
0
votes
2 answers

Using a base class's methods inside a derived class's methods

I have a very poor understanding of inheritance and I can't seem to find the answer I'm looking for. I apologize for the length of this post but I feel I need to be very specific. I have a base class "ProgCtl" which can send signals to processes. I…
0
votes
1 answer

Scala class method to function with class instance as parameter

I'm pretty sure what I'd like to do is probably not possible and not a good idea anyway. Nonetheless, here it is. I would like to find a generic way of transforming any method on any class into a function that takes as arguments an instance of the…
0
votes
2 answers

Calling another function from another class in java

I'm new in java an having some trouble in calling of another a function from a class login which records a session user getting the date and time of login.. I would wish to call this function in a sales class where the users name will be retrieved…
0
votes
0 answers

passing value from one class to other in JavaFX

I am some how trapped between 3 classes, and I can not find out why I get null value. I want to pass a file path after choosing to Draw button, and after clicking draw, a constructor from other class should get fired. I have a controller class with…
Iman
  • 769
  • 1
  • 13
  • 51
0
votes
1 answer

using join-path in a method call

Trying to write to a file and did the following: $obj = New-Object System.IO.StreamWriter -ArgumentList join-path $pwd foo.txt This threw an error PS C:\code\misc> $obj = New-Object System.IO.StreamWriter -ArgumentList Join-Path $pwd…
deostroll
  • 11,661
  • 21
  • 90
  • 161
0
votes
1 answer

Calling a parametrized method

While learning Java Generics parametrization I came up to this code: public interface Comparable { public int compareTo(T o); } public static > int countGreaterThan(T[] anArray, T elem) { int count = 0; for (T…
ajuric
  • 19
  • 2
0
votes
1 answer

C++: Call a non static method from macro

I was testing some features of c++ with varargs when I eventually got blocked by a macro call. First, I have a class : class TestManager { public: void assertTestSeq(int n, ...); [...] And I want to be able to call this method,…
KwentRell
  • 416
  • 1
  • 4
  • 17
0
votes
1 answer

method call - empty parameterfield

Why doesn't this run? The superclass and other classes should be ok. Are there any obvious mistakes? When I create the object and when I click void main(string []args), BlueJ says ''method call'' empty parameter field in a new window. Please help,…
fruzz1
  • 15
  • 2
0
votes
0 answers

How to use this method?

I am very close to finishing my task, but I can't figure out how to call findChange() correctly. My guess is that it needs to be in the main method. But when findChange(); call it, it asks for int, List, List so how do I do this…
Junikin
  • 301
  • 2
  • 14