Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
0 answers
59 views

class parent{ private String x = "Parent"; public void printmsg() { System.out.println("value is "+ this.x); } } public class child extends parent{ ...
Bhupesh's user avatar
0 votes
0 answers
129 views

I would like to send emails from APEX or PL/SQL. This works if the FROM parameter is the same as our Instance Administrator has configured in SMTP. I have the email adress, but I would like to ...
Allard Hillebrand's user avatar
0 votes
0 answers
24 views

When using a GUI design software, an instance variable cannot be accessed outside after being modified inside a nested function triggered by mouse events like on_motion. The instance attribute stores ...
G sink's user avatar
  • 1
4 votes
0 answers
44 views

Problem Description I've encountered an interesting behavior in Java regarding forward references in instance initializer blocks. When I try to access an instance variable directly, I get a forward ...
happy's user avatar
  • 515
-1 votes
1 answer
58 views

In Part 5 Primitive and Reference variables section, there is a Person class defined and then another class called TimeMachine which has a reference variable defined for type Person. public class ...
Peja77's user avatar
  • 11
-2 votes
2 answers
67 views

I am basically writing static methods that perform work on a list of strings but I can't quite determine if it would be better to create instance variable and do all the work internally. In case my ...
zaxunobi's user avatar
  • 962
0 votes
1 answer
69 views

In the Setter Method "setName()", int the first line, name=this.name ; takes the value of the string "nidhi" in the second line, this.name=name; what actually happens i can't ...
HappyCoderNids's user avatar
1 vote
2 answers
117 views

I am working on optimization problems. As you know, optimization is an iterative process. Some sections are selected, and the weight of all sections is calculated. I have code like this: class Test: ...
torunoglu's user avatar
-1 votes
2 answers
101 views

I recently stumbled upon this weird behaviour of Java where a variable of type Hashset, which is declared private in the parent class, is not unique for each instance of the child. Instead, all the ...
ACP's user avatar
  • 1
0 votes
2 answers
2k views

I'm new to using java and I need to make a class called Rectangle, but the code I'm using doesn't seem to work, and the notes for class aren't helpful. I feel like it has something to do with my ...
Sheebs's user avatar
  • 15
1 vote
1 answer
203 views

I am trying to avoid repeatedly passing a struct in my functions in order to access its fields. In Java this can be avoided by using a class and defining instance variables. What's the equivalent in ...
Brandon's user avatar
  • 89
1 vote
2 answers
64 views

I just feel like I'm not doing this correctly and I have researched and just can't seem to wrap my head around how to initialize variable that have to reference another method or class. Player class ...
Amber Lyda's user avatar
0 votes
0 answers
163 views

this is bit of a loaded quesiton but thought i may give it a go. We have similar db code for diff projects so we decided to wrap Sequelize into its own module. basically, i have this format const ...
Tanner Summers's user avatar
0 votes
2 answers
68 views

Let's say I am working on a problem where a class object will only be instantiated once, such as a Gem configuration object. The configuration class calls many classes that use the configuration class ...
TenJack's user avatar
  • 1,642
1 vote
2 answers
606 views

I am not sure how to design of my Java classes, the question is also related to better testing. I am using static utility class/method Utils.getMapper() to get configured ObjectMapper at many places ...
jnemecz's user avatar
  • 3,676
0 votes
1 answer
33 views

I am trying to create a new object of teacher and student but it is giving me an error. It stops giving me the error if I remove static from main but then it can't find main to run. I really do not ...
Frankenbtiz's user avatar
0 votes
2 answers
68 views

I'm looking to use class objects to store data from multiple simulations and save them in a list, each entry in the list a new instance of the class). I'd like to ensure that each instance has exactly ...
Henry's user avatar
  • 3
1 vote
3 answers
50 views

For example lets say there is a player object with an instance variable: public class Player { private final PlayerConnection connection; private final PacketSender sender; public ...
Oshino's user avatar
  • 11
-2 votes
1 answer
69 views

Here is my code ` class Cats: def __init__(self,name): self.name=name #print(self.name,name,"hello") def change_name(self,new_name): self.name=new_name ...
Vikrant KALKAL's user avatar
-3 votes
1 answer
265 views

I am a beginner of C++ with Python background. I have some ambiguity about the process of obtaining instance attributes in Python classes and C++ classes. As follows, I list two classes that have the ...
Ili a's user avatar
  • 1
1 vote
1 answer
159 views

I am trying to learn the python class variable concepts, while doing so I have encountered below issue. I would appreciate if anyone can help me in understanding why this below mentioned behavior ...
shivakumar's user avatar
2 votes
1 answer
482 views

I cannot figure this out even though I watched videos about Object Oriented Programming and Classes in python. Simplified scenario: 2 classes. class1 is basically a window with two buttons (button1 ...
Alena's user avatar
  • 23
0 votes
1 answer
103 views

I am trying to use a completion handler in a view model that assigns values to @Published variables. I get an error stating I cannot use instance members within the property initializer. I tried ...
Chris's user avatar
  • 165
2 votes
1 answer
2k views

I don't have any formal training in programming, but I routinely come across this question when I am making classes and running individual methods of that class in sequence. What is better: save ...
Fruity Fritz's user avatar
-2 votes
1 answer
52 views

What will happen if I define a class like below code with Swift, the complier doesn't give any errors: class Test { var test = Test() }
Peruser's user avatar
  • 11

1
2 3 4 5
31