19 questions
0
votes
0
answers
52
views
How is it possible to access Object class methods using an interface reference variable? What is the underlying mechanism that allows this to work?
I am working on a Java project and I have defined an interface, a class that implements this interface, and a user class to test the implementation. I am confused about how I can call methods from the ...
0
votes
0
answers
56
views
Shared variables not working when create a new class instance
I have a class (ServerASync) with a shared Hashtable variable bSocket_Monitored.
The variable values of bSocket_Monitored are shared between instances in different way in respect to how I declare the ...
1
vote
1
answer
152
views
Override Object methods inside interface using default methods- Misleading error
Question: Need to understand why in case of Program 1 getting this misleading error, but in Program 2 it gives correct error? Also why unlike toString(), equals(Object), and hashCode(), overriding ...
0
votes
1
answer
91
views
Get a string when running an object class through str.replace(obj_cls, "new string")
I have an object class:
class Color(object):
def __init__(self, color):
self.color = color
I want to run the following commands:
blue = Color("blue")
print blue
"The pen ...
-1
votes
2
answers
922
views
Does Java Enum Classes by default extend Java Object Class? [duplicate]
I have defined my own enum, which will extend Java Enum Class. Does Java Enum Class extend Java Object Class?
enum ORDER {
FIRST,
SECOND,
THIRD,
FOURTH
}
1
vote
3
answers
2k
views
How to make static array in Kotlin?
I am trying to make a static array in Kotlin. For doing this, I created an Object class, and inside that declared a mutableListOf<PersonModel>().
When I try to add new Object PersonModel to ...
1
vote
1
answer
96
views
Unable to split string to array and store to array object in Android Java
Is there any way to splits a string into an array and loop it into an array class in android java?
Below is my code but it cannot loop
Sample ScanResultProduct record ="P001,7,1,7,P002,8,2,16&...
1
vote
1
answer
785
views
Reference Comparison and Content Comparison in Java
I was learning about Reference (or Address) comparison and Content comparison. The below statement makes me confused:
If a class does not override the equals method, then by default, it uses the ...
0
votes
1
answer
1k
views
How to create "dynamic group" in ldap?
I want to create dynamic group in openldap with Apache Directory Studio but groupOfURLs object class not available.
1
vote
2
answers
84
views
What is the logic behind == returning false [toString()] when two reference variables are referring to same Object having same hashCode? [duplicate]
What is the logic behind == returning false when two reference variables are referring to same Object having same hash code values?
public class One {
public static void main(String[] args) { ...
0
votes
2
answers
792
views
Serialize/Deserialize Json Object class structure [duplicate]
Thank you in advance. I am really stuck on this one, but practicing. Thank you in advance for any help.
I am able to successfully build this Json object in my code, but de-serializing it with the same ...
5
votes
3
answers
10k
views
Error in UseMethod("rescale") : no applicable method for 'rescale' applied to an object of class "c('haven_labelled', 'vctrs_vctr', 'double')"
I am getting the following error:
Error in UseMethod("rescale") : no applicable method for 'rescale'
applied to an object of class "c('haven_labelled', 'vctrs_vctr',
'double')"
...
0
votes
0
answers
37
views
How to parse json file to be Array in object Class?
I got confused when Im try to parsing json in object class.
Im using klaxon but I just wonder how to read the file because I cannot use activity or application to add it into buffered object.
enter ...
-3
votes
2
answers
278
views
Explanation of toString method output and difference between toString out and hashCode output
public class ObjectClass {
public static void main(String[] args) {
Demo dm = new Demo();
Object obj = dm.getObject();
System.out.println("Class name :: "+obj....
0
votes
1
answer
1k
views
How to retrieve every objectClass available with python-ldap?
Given a valid python-ldap context, how can I query all the objectClass available in the LDAP server? I suppose the result would be a list of ldap.schema.models.ObjectClass.
1
vote
2
answers
3k
views
Check that a variable is an instance of a Class Object in WooCommerce
I am running a function whereby I check if a user has a refunded item/s on their previous order and if they do then apply a credit as a negative cart fee at checkout. The function is working for users ...
0
votes
1
answer
254
views
use object of S4 class SeqExpressionSet to plot PCA with ggplot2
I have made an object of S4 class SeqExpressionSet with EDASeq which I can then analyse with plotPCA.
However the plotPCA function lacks the ability to fully adjust aesthetics. I was therefore ...
0
votes
1
answer
102
views
How can I verify that two classes are assigned to the same city? Follow-up issues
There are three classes with interfaces Train: ITrain, Line: Iline and City: ICity. Generally, I advanced in the code and resolved TEST 3 & 4 but caused new issues.
I have following issues:
1. ...
1
vote
1
answer
1k
views
Kotlin Memory allocation behaviour for object class and companion object
Kotlin provide a better way to create singleton object and companion object to access class member via class name. Cool this is !!
But how the memory allocation work for both declaration, does this ...