Questions tagged [class-constants]

In object-oriented programming, a class constant is a constant defined within a class.

In object-oriented programming, a class constant is a defined within a .

97 questions
-1
votes
1 answer

How to use a Constant value of a class field in a layout?

I would like to use some java class constant value in my XML layout. Is that possible? java class public class ConstantKey { public static final String COUNTRY_CODE = "+00"; public static final STRING COUNTRY_NAME =…
Shomu
  • 2,734
  • 24
  • 32
-1
votes
1 answer

How can I implement JSplitPane.TOP and BOTTOM constanstants in when adding a JScrollPane to the JSplitPane?

I have two panels , one is JTree in a JScrollPane and the other is JTable in a JScrollPane. How can I place them in adjacent position using the JSplitPane.TOP and JSplitPane.BOTTOM constants so that they must equal space in the main panel?
-1
votes
1 answer

OOP PHP: Is it okay to store configuration strings in constants?

I am writing a class to process an associative array. Inside the class, array keys are used in getter/setter like functions. Since I can't guarantee that the array keys will never change (either technical requirement or simply for convenience), is…
Sven
  • 12,997
  • 27
  • 90
  • 148
-2
votes
1 answer

NDK: How to use .c constants in java class

I am trying to define constant in .C file and use that constant in .Class file in my class. How can I do that? I am totally new for NDK. I defined constant here. const jstring BASE_URL ="http://www.google.com";' currently i am using that constant…
curiousMind
  • 2,812
  • 1
  • 17
  • 38
-3
votes
1 answer

How to define a private constant variable in Angular 2+ components

Do we have something like private static variable in component itself. Not like Global Constants , But something private to the class (component) itself.
-3
votes
5 answers

Modify Class Constant in Python

In Python, I define a class: class X(): _CON = 0 def __init__(self, var): self.y = var*self._CON Is it possible to change the constant _CON for an instance of X? For example, I attempt to do the following X._CON = 3 x = X(2) a =…
Hans
  • 1,269
  • 3
  • 19
  • 38
-4
votes
1 answer

What does Predefined constant mean in PHP for a module like trader

I am using this module PHP trader. I am not able to understand what "Predefined constant" means. Should we define these before we call the functions? Should we define them as numbers, or is there no need to mention them before calling the…
Ajmal
  • 51
  • 1
  • 11
1 2 3 4 5 6
7