Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
120 views

class PictureList { void clear(); void load(json); void clearAndLoad(json); void draw(); } in general clear needs to be called just before load. Creating just clearAndLoad avoids ...
Fractale's user avatar
  • 1,704
0 votes
0 answers
88 views

This could be a stupid question for most of you who are experts in programming, but I'm not a professional and I've been moving my first steps so it's not so obvious to me. I developed a VB.NET ...
sickboy's user avatar
  • 13
-4 votes
1 answer
97 views

I have a base class with a public method, but when I try to call it from a derived class which inherits publicly from the base class it becomes private. How is it possible? Shouldn't public ...
Alessandro's user avatar
-2 votes
1 answer
331 views

While I transformed parts of my code into methods, an integer I mean to increase under a certain condition (the player score) doesn't. This is a series of methods inside other methods inside a single ...
jpeg_louie's user avatar
0 votes
2 answers
551 views

I am implementing a Color Picker into my app. It works as intended, but i need to save the color as a public variable to use it in the next View. I have coded the following: struct Upload: View { @...
KodeKat's user avatar
  • 15
2 votes
1 answer
1k views

Why can you call a private method on a new instance made inside a public method of the same class type? class Foo { private function thePrivateMethod() { echo 'can not be called ...
gawpertron's user avatar
  • 1,947
1 vote
1 answer
1k views

I have three forms in total and i want to trigger one of the button on form 3 to be triggered automatically when form 1 loaded Form 1 Public Class frmIOMain ' In This Form load I want to trigger ...
Muhammad zubair's user avatar
1 vote
1 answer
504 views

hello everybody im trying to delete an image from local storage with this function but it returns Call to a member function delete() on string which is right because when I use dd(destination); this ...
Martin2236's user avatar
0 votes
2 answers
687 views

I have the following problem, I am trying to call InterstitialLaunch.java from MainActivity.java to display Interstitial, however, in my case it reports an error from MainActivity.java and says that '...
Dejo's user avatar
  • 141
1 vote
0 answers
69 views

I have been following two different tutorials regarding in-game day night cycles. One is for a TimeTickSystem that enables fires to light up as specific events. The other is for a DayNight cycle that ...
Ilias from Ilios's user avatar
0 votes
2 answers
91 views

I am an Android developer and I have made a string for generating a random 6-digit OTP which is there in the protected void onCreate(Bundle savedInstanceState) {, the first thing in a java program.: ...
user avatar
3 votes
6 answers
4k views

I am studying for a very basic / beginners Java exam, and when reviewing some example code, I noticed a couple that did not include the method: public static void main(String[] args) How is this ...
TheLostBoys's user avatar
1 vote
1 answer
2k views

Sanity check. I am still pretty new/dumb when it comes to OOP PHP. PhpStorm (PS) warns that "$nowGmt" is "probably undefined". Is PS being over fussy or am I missing something ...
BeNice's user avatar
  • 2,335
1 vote
0 answers
41 views

I have a class Airplane: class Airplane { private: int value; public: // some public functions that arent relevant }; and then another class that derives from Airplane class ...
Max's user avatar
  • 15
0 votes
1 answer
157 views

By following the OOP approach, I am writing reusable methods into traits rather than creating a plain helper file. So that I can control access in an organized way. For that, I have created various ...
Code Lover's user avatar
  • 8,408
0 votes
0 answers
158 views

i have two methods in same class method1() and method2(). method 1() is to read a 'String' and extract integers from that string and method2 () is to perform a click operation. This click operation ...
Abhimanyu Singh's user avatar
0 votes
1 answer
126 views

I have trouble understanding how an inherited method in a subclass from a superclass differs from a public method in a class which can be used in another class.
user avatar
1 vote
2 answers
686 views

I try to call a (public static) function of a plugin in my functions.php, but that doesn't work. I tried this code: include_once( ABSPATH . '/wp-content/plugins/atum-multi-inventory/classes/Models/...
Chrostip Schaejn's user avatar
1 vote
1 answer
319 views

I was working on a homework assignment and I stumbled upon a roadblock I created a linked list class that looks something like this List.h class List{ struct Node{ string data etc......
AlexDong11's user avatar
0 votes
0 answers
92 views

I have a class which contains a function, so I want to be able to call a class method inside the function I want to find a way to access the class method send and the attribute file inside the ...
usama hamed's user avatar
0 votes
3 answers
182 views

I am parsing an C++ header file using ClaiR and want to get a list of the public functions. visit(ast) { case \class(_, name(n), _, decs): { println("class name: <n>"); ...
Matty's user avatar
  • 134
0 votes
1 answer
66 views

I'm trying to call the public function validInfixCheck() in main but I'm getting this error when trying to compile: g++ calculatorMain.cpp CalculatorExp.cpp In function `main': calculatorMain.cpp:(....
crownM's user avatar
  • 31
1 vote
0 answers
37 views

Given the following class template definitions template<typename T> class node{ private: T& data; shared_ptr<node<T>>& next; public: T& ...
Vinod's user avatar
  • 1,215
0 votes
1 answer
116 views

I have a matrix object that I have written. I have intended that the matrix is immutable as an attribute of the object, implemented with a mutlidimensional array. as this.matrix. When I call the ...
bell_pepper's user avatar
4 votes
1 answer
278 views

I'm currently reading "The Well-Grounded Rubyist", and on page 196 I see the following: Suppose you define a method at the top level: def talk puts "Hello" end .... A method that you ...
Richie Thomas's user avatar
-4 votes
1 answer
650 views

I have been given this code with the restraints that i can not edit the public in anyway and am not allowed to call any other library's other than the ones specified. Class example { private: ...
herbeir's user avatar
-1 votes
1 answer
210 views

This question stems from several related questions, and is somewhat reasking the first which doesn't seem to have a clear answer to the OP's main question: Private Methods Over Public Methods Why hide ...
Dewick47's user avatar
  • 171
0 votes
0 answers
290 views

I want to make a public: or friend function to a class return the address of a pointer whose type is defined as a private member of the class. Example:- class LinkedList{ struct Node{ int data; ...
Divyang Vashi's user avatar
0 votes
3 answers
1k views

so basically I have several different Java classes in Android studio. One of these classes contains a host of functions that I need to call from different classes based on what the user selects. My ...
Jamie A-Reade's user avatar
0 votes
1 answer
588 views

I give up. I'm usually a c# developer, but I need javascript for this particular project. I have a list that I want to be protected with some setters and getters (and also public methods vs private ...
Retired Cosmonaut's user avatar
0 votes
1 answer
3k views

m2 is much different than m1. When I'm writing code (programming public methods) in the template they don't seem to be working. Are all methods allowed like protected and private as well? or getters ...
getData's user avatar
  • 123
-1 votes
1 answer
1k views

I have run this code and looked online for solutions. How can I fix this error? I saved PastPresentFuture.java and it still won't run. YourName.java:7: error: class PastPresentFuture is public, ...
Shruder's user avatar
1 vote
1 answer
149 views

I've a method in my SKScene as: func someTypeMethod() { print("someTypeMethod...") } I tried to call it from my 'ViewController' as: if let scene = SKScene(fileNamed: "Scene") { ...
Thampuran's user avatar
  • 654
-1 votes
1 answer
30 views

Lets say I have this function, I am trying to get values of value1 and 2 , what’s the right way to do it. 1. how do I make value 1 and value 2 defined , when it exits the function 2. how do i get the ...
makusa's user avatar
  • 1
6 votes
0 answers
475 views

Given a public API which triggers OTP verification to users, is there a way to prevent such an API from abuse/spam? This API is public and have business reasons so offering on public side. API is ...
suman j's user avatar
  • 7,000
-1 votes
1 answer
35 views

I defined a Logininfo class to store the email and password of a user in. I get the email and password from a Login GUI. There are put into the Logininfo class using setMethods. I'm connecting the ...
Heijkoop's user avatar
1 vote
5 answers
1k views

I've one PHP class, in that I found one a function e.g public static function success(string $userid, string $message):bool { return self::add($userid, $message, 'success'); } Can someone please ...
techsu's user avatar
  • 813
1 vote
6 answers
1k views

In template method pattern, there is a method marked final, but I cannot understand the meaning of having this method. Please help me out. In another word, in class PackageA, one can implement the ...
mybebr's user avatar
  • 19
0 votes
1 answer
744 views

My main method in a package by itself can only see some of the methods in the other package even though they are all public. This is an example of my code. package stuff.code; public class ...
D.B's user avatar
  • 33
-2 votes
2 answers
2k views

I have created a simple class, variable, and public function. When I try to initiate an object and call the public function from the class outside of the class, I get no output that I can see. <?...
Dan's user avatar
  • 437
-3 votes
2 answers
142 views

Pretty simple question I imagine, just can't seem to figure out the right way to do it. I have a method that produces my total "cost" (a pre-defined 'double' variable) as a dollar amount here: ...
BCarmar's user avatar
  • 11
1 vote
1 answer
4k views

I've got a button element in my *ngFor list item: <li class="cart__item" *ngFor="let item of cartService.cart$ | async"> <button class="button button--decr" (click)="decrItem()">-</...
Alexandr Belov's user avatar
0 votes
1 answer
756 views

I'm using Babel with default es2015 preset to convert ES6 JS code. Since I'm working in another project with TypeScript, I've come to appreciate the publi/private annotation on methods. I'd like to ...
don's user avatar
  • 4,562
-3 votes
1 answer
172 views

I wrote a method but method cannot return i value. What can I do ? public static int contain(String s1,String s2){ //I want wrote a method similar contain if(s1.length() == s2.length() || s1....
Alperen Bayar's user avatar
0 votes
1 answer
32 views

I've been having some issues trying to solve this code that my professor sent to me for studying purposes. I usually can solve the isPrime and getPrime no problem but my issue lies with the gcd class. ...
Kowalchu1's user avatar
-1 votes
3 answers
3k views

The structure of my project is following: Activity - Fragment - Class The issue: in Class according to some conditions show a Toast The problem: I can't call a Context from the class by getActivity()...
tadvas's user avatar
  • 171
0 votes
1 answer
152 views

Yes, like I wrote the ask title. I want to know it is possible know or see the someway the approximate geolocalization through public ip. I have an arduino with ethernet shield. Thanks, I've been ...
Maclos's user avatar
  • 7
0 votes
1 answer
91 views

So I can't seem to find astraight answer on this, only vague examples of multiple variations where similar plugin/method declarations are used. I know that by saying $.fn.myPlugin I am defining a ...
Mike's user avatar
  • 647
3 votes
1 answer
3k views

public void publicMethod() { for (i=1;i<10;i++) privateMethod(); } private privateMethod() { something... } I need to write a JUnit testcase to verify the number of times the ...
Avi's user avatar
  • 39
0 votes
2 answers
32 views

I've been reading Javascript Patterns by Stefanov recently. And I found this example confusing to me here: Another case of using a convention to mimic functionality is the private members >con- ...
Eli Zhang's user avatar