Questions tagged [public-method]

A public method is a method declaration that allows access from other classes external to the current class.

A public method is a method declaration that allows access from other classes external to the current class. Public methods are used in many Object-Oriented programming languages including Java, C#, and Objective-C

From http://www.javabeginner.com/learn-java/introduction-to-java-access-modifiers

Fields, methods and constructors declared public (least restrictive) within a public class are visible to any class in the Java program, whether these classes are in the same package or in another package.

184 questions
1
vote
2 answers

jQuery tagit plugin, public methods

Does anyone know if the tagit jQuery plugin has a public method for removing just 1 specified tag from the list? I saw there is for removing (clear) all tags from the list, but I would need to remove only 1 tag :P Also, how to call all the public…
itsme
  • 48,972
  • 96
  • 224
  • 345
1
vote
1 answer

Why can you call a private method on a new instance made inside a method of the same class type, in PHP?

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 publicly?'; } public function…
gawpertron
  • 1,867
  • 3
  • 21
  • 37
1
vote
1 answer

How to Trigger button click from another form VB Net

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 the above mentioned button Private Sub…
1
vote
1 answer

cant delete image from storage laravel

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 is the result: public/imagen/1634302328.jpg …
Martin2236
  • 33
  • 5
1
vote
1 answer

Attaching a public method to a prototype

This is my code: var Quo = function(string) { //This creates an object with a 'status' property. this.status = string; }; Quo.prototype.get_status = function() { //This gives all instances of Quo the 'get_status' method, …
dopatraman
  • 13,416
  • 29
  • 90
  • 154
1
vote
2 answers

Defining all public methods or prototype individual methods?

So when I make a library, I usually do it in this fashion: var myLib = (function() { return { publicProperty: 'test', publicMethod: function() { console.log('public function'); }, anotherMethod:…
1
vote
0 answers

I am trying to make two different time keeping scripts work together

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 rotates the sun and enables starts to fade in and…
1
vote
4 answers

Is it possible to write Java code without public static void main(String[] args)?

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 possible? Is there something I am missing? Example…
1
vote
1 answer

Variable "probably undefined" - am I missing something?

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 obvious (looks good to me). public function nowUTC($type) { if…
BeNice
  • 2,165
  • 2
  • 23
  • 38
1
vote
0 answers

How do I access a derived classes data members when creating a pointer of the base class to hold the derived class?

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 Model : public Airplane { private: bool…
Max
  • 15
  • 3
1
vote
2 answers

Public Methods Inaccessible in Object Array

i have the problem of not being able to call my own methods in object elements of an array Here is the code for the part of the code with the array: public class CardRules { private Object cardArray[]; public CardRules(Object…
Samual
  • 11
  • 1
1
vote
2 answers

Call a plugins' function in my theme in wordpress does not work

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/Inventory.php'…
Chrostip Schaejn
  • 2,347
  • 1
  • 6
  • 13
1
vote
1 answer

Class member function unable to access a private struct node of the same class?

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... } public: Node* lastNode(Node*…
AlexDong11
  • 11
  • 1
1
vote
0 answers

Compiler error related to public method granting access to private class member

Given the following class template definitions template class node{ private: T& data; shared_ptr>& next; public: T& get_data(void); shared_ptr>& get_next (void); public: …
1
vote
1 answer

How to call a method inside my 'SKScene' from 'ViewController'

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") { scene.someTypeMethod() } But Xcode is saying…
Thampuran
  • 644
  • 5
  • 22