Questions tagged [methods]
A method is a block of code that performs a task and is associated with a class or an object. It is related to the non-object-oriented concepts of functions and procedures.
methods
30,470
questions
0
votes
0
answers
12
views
How to open "send this server message to my contacts" menu in telegram mini app
Good afternoon, i now working on telegram mini app project, and cant find way to open send message menu in that telegram app. User press button, then he see his contats, choose one and send to that ...
-5
votes
1
answer
30
views
Calculating the volume of a square
package Pyramid;
import java.util.Scanner;
public class SquareVolume {
public static void main(String[] args) {
double length = 0;
double width = 0;
double height = 0;
...
0
votes
0
answers
20
views
How do I use import for built-in modules for node.js
I am making a webapp to send emails using node.js. In accordance to the ECMAScript 2015 standards, I have not been using require(), but import/export.
import url from "url";
import path from ...
1
vote
1
answer
42
views
Inherit override-equivalent as different methods
Several methods from interface, super class or new method are override equivalent. I need to make different realization for each. Example:
public interface A {
int f();
}
public interface B {
...
-2
votes
0
answers
32
views
Why do we declare public class at the start of Java code? [duplicate]
In java, whenever we write a program, the first line of the program always starts with public class name_of_class{}
When I googled the reason of why we have to mention public class at the start of ...
-1
votes
1
answer
60
views
Write a method that takes 3 integer as parameters, return true if they are equal, return false otherwise without using if statement [closed]
I am trying to write a method that compares three integers without using the if statement. I tried the switch statement, but it wouldn't work. Eclipse shows case expressions must be constants.
Here is ...
1
vote
2
answers
38
views
C# reflection: Get static method with multiple generic overloads [duplicate]
How we can get a method such as Tuple.Create that has multiple generic overloads through reflection and use it with our custom generic type arguments?
usecase: the generic type arguments are known ...
1
vote
1
answer
44
views
Unable to update the currentIndex to the one where the selected modal is opened
I have a class where I can open the gallery. The problem is that this line of code doesn't reflect to the currentIndex. As a result, whenever you click a gallery img, it opens the gallery and its ...
0
votes
0
answers
32
views
Calling methods from array of method pointers not executing [duplicate]
This doesn't execute any suggestions:
void (CClient::*pMethod[CNetwork::ClientEvent::E_CE_MAX_EVENTS])();
pMethod[CNetwork::ClientEvent::E_CE_ACCEPTED] = &CClient::Accepted;
pMethod[CNetwork::...
-2
votes
0
answers
31
views
What is the need of having different types of request methods(get,post,put,delete)?
I can achieve whatever a get/put/delete request achieves using a post request (by writing whatever the logic is inside the method). Then what is the point of having different methods.
There must ...
0
votes
0
answers
9
views
After being appointed as the owner of the group, messages stopped leaving
Good afternoon. Until recently, the script worked well:
from telethon.sync import TelegramClient
api_id = '***'
api_hash = '***'
session_name = 'my_session'
client = TelegramClient(session_name, ...
3
votes
1
answer
52
views
TypeError: Privileges.show_privileges() missing 1 required positional argument: 'self' [closed]
I'm a beginner in python and I'm using python crash course 2019 as my reference. I'm having difficulty figuring out what is wrong with my code gaining the type error as said in the title. here is my ...
0
votes
0
answers
63
views
Method That Returns BOOL Relying on other Service How to Catch Exceptions
Running into a predicament. New to C# but trying to go through and catch all the exceptions that could be thrown.
I am reading Values from a PLC using twincat ADS. If it cant find a symbol/Address it ...
0
votes
1
answer
49
views
Why is seq function output not consistent? [duplicate]
I am using seq function. While it gives correct output for positive numbers when used input is given using :, I am not sure why does the following 2 ways produce different outputs (when input starts ...
1
vote
1
answer
42
views
Why is the following behaviour observed while dealing with a text file object opened with 'r+' mode in Python?
I was going through file handling in Python and experimenting with different file modes. In a certain scenario with file mode as 'r+', I was unable to make sense of what was happening while using the ...