Questions tagged [private-methods]

285 questions
1
vote
3 answers

How do I call a private method with arguments

I'm having an extremely difficult time getting a private method with arguments to be usable in my toString method but have no idea how to get the two methods to cooperate. main class: import static java.lang.System.*; public class Triples { …
tech_geek23
  • 229
  • 2
  • 10
  • 23
1
vote
1 answer

How can I return multiple variables and/or use a private int method?

Here's my code as it stands: import static java.lang.System.*; public class Triples { private int number; public Triples() { this(0); } public Triples(int num) { number = num; } public void setNum(int num) { number = num; } private…
tech_geek23
  • 229
  • 2
  • 10
  • 23
1
vote
3 answers

Inherit in private methods of inner classes

Let's take the following code: public class Test { class A { public A() {} private void testMethod() { System.out.println("A"); } } class B extends A { public B() { super(); } …
José D.
  • 4,175
  • 7
  • 28
  • 47
1
vote
1 answer

Is it possible to use private Samsung frameworks in my own app?

For last two days I was exploring a possiblity of using private Samsung frameworks in my own app, /system/frameworks/seccamera.jar in particular. Nothing worked yet so I'm wondering if it is possible at all. Some background I am developing an…
0
votes
3 answers

Why user private function?

So the have seem something like this today: $$('input').each(function() { // do something }); What is the difference between that and this: $$('input').each( // do something ); The private function on the first example is within that for loop…
Churk
  • 4,556
  • 5
  • 22
  • 37
0
votes
1 answer

How to use private static methods from another class

I am writing class that extends adobe air PNGEncoder, I want to use the writeChunk method, but it seems to be private static and i cant seems to use it with my code But it gives the error as below ERROR : Description Resource Path Location …
0
votes
1 answer

rails 3.2.1 custom module restrict private instance methods access by the controller

** Using Rails :3.2.1, Ruby: ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux] ** In my module I have one private instance method (get_tables_of_random_words) and one module function (get_random_word) . From my Rails Controller I am invoking…
Jignesh Gohel
  • 6,236
  • 6
  • 53
  • 89
0
votes
3 answers

NSWindow: alternative to -setOpaque:NO

I want to have a window which is like QuickTime X window. An all opaque window with rounded corners. I've obtained it implementing a custom borderless NSWindow with: [window setOpaque:NO]; [window setBackgroundColor: [NSColor clearColor]]; and a…
Andrea3000
  • 1,018
  • 1
  • 11
  • 26
0
votes
2 answers

Method Retrieval and Inheritance Confusion

Ok,so I am getting a lot of trouble, I am still learning Java and my book has set me a task that I find common over the net, the part that I am stuck on is... I must create a bank account program, an account holder is given a savings account (which…
Phil
  • 1,393
  • 5
  • 23
  • 42
0
votes
4 answers

Moq c# private method to throw an exception

Given this class: public class MyClass { private void MyMethod() { //... } public void Execute() { try { //... MyMethod(); //... } …
radu florescu
  • 4,315
  • 10
  • 60
  • 92
0
votes
3 answers

How to write a private method that returns True for certain peramaters?

So the exact wording is, "Write a private method isValid(aRating) that returns true if the given rating is valid, which is between 1-10." private void isValid(aRating) { } What Goes in the Method above in order to return a true value if given…
Renuz
  • 1,587
  • 7
  • 21
  • 34
0
votes
0 answers

Define private class *methods* with Google Apps Script

I want to create a class that has private methods. For example: class RabbitDefiner { #define(){ return "a rodent"; } } I get: Syntax error: ParseError: Unexpected token ILLEGAL In other threads I've seen that private fields aren't…
0
votes
0 answers

How to write testng testcase for private final anonymous class

private final SampleFormatter sampleFormatter = new SampleFormatter() { @Override public String formatDouble (int tag, double Value, int pre) { if (Double.isNaN(Value)) { return "NaN"; } if (Value ==…
0
votes
1 answer

Using a private field (#) as the typeof for an element

Check this code interface PriceFormatOptions { unit: string; } export default class PriceHelper { /** * Adds unit and separates thousands */ static format( price: Parameters[0], options:…
Ali Ehyaie
  • 1,116
  • 3
  • 13
  • 27
0
votes
1 answer

Base class has inacessible destructor

The following code tries to define a self-similar datastructure JSON using the std containers std::vector and std::unordered_map but does not compile. It all seems to come down to std::unordered_map's hashtable deleting its destructor because it is…
glades
  • 3,778
  • 1
  • 12
  • 34