class

I can initialize a member variable from a class for example with a constructor, of course but i can also do this by creating a variable of type class from which i could use it's members and initialize them by doing a function. So, i would like to kno

In the package java.lang I see, public final class Class<T> extends Object implements Serializable, GenericDeclaration, Type, AnnotatedElement Where exactly is the 'class' (the word used after 'public final') defined so that it could be used to decl

Working on some homework for a while now and can't seem to figure out how to get around this error. Just to note, I am not allowed to import anything. The error I am getting I think is due to either my __repr__ or __str__ methods. Here is my code: cl

I'm using the SimpleDateFormat and Date class to get the current time. The watch face I am developing for Android wear requires the text version of the time. For example, 8:30 would be "eight" and "thirty", 9:21 would be "nine&quo

I am trying to write a constructor for a class "Block" which stores the coordinates of the center of the block (either as separate x- and y-coordinates or as a pair of numbers) and for the width and height of the block. The problem I am having i

I need to create a final project for a Beginning Python class and I decided to create a riddle program and want to simplify the following code, but am unsure how to do it. I would like to use a class to do this, but I'm having trouble figuring out ho

I am having a problem with calling a method that is in a different class. This main method is in a class on its own called lab14, and the heapSort() method is in a different class called HeapSort. Both of these classes are in the default package. I a

I'm trying to understand the best way to set up a class in .NET 3.5. I have a JSON object that's a collection of Order Shipments defined as something like this: [ { "BaseOrder": { "order_id": "503", "BillingAddress"

I've researched this error and it seems common with dangerous memory allocation or overload, but I can't find where that applies to my code. Basically I keep receiving the error message: Segmentation fault: 11 every time I run my code after calling m

I am trying to store multiple user inputs as a byte based file and then take the files numbers and use them for calculation in the program I have written. I started by converting the string to a double, but the I ran into the issue of reading the val

I'm trying to use events to update a textbox from a background worker from a different class. It is the same problem as mentioned in this SO post, except I'm using VB.NET. I'm trying to implement the 2nd suggested solution by @sa_ddam213. I'm getting

I am trying to pickle and unpickle an instance of a data class that I am working with and it works all okay on Unix: import dataclass as dc data = dc.DataClass() f = open(filename, 'wb') pickle.dump(data, f) f.close() f = open(filename, 'rb') unpickl

This question already has an answer here: How do I use arrays in C++? 5 answers I have been trying to make a simulator which involves ants randomly running around (for now...) I want to make a array of "Ant" to contain all my ant information and

When a class of properties (let's call it class_X) is being instantiated from another class, all of class_X's methods and functions are also included in every instance. Q1: Wouldn't that add substantial overheads, especially if there are multiple ins

I am trying to take 3 different programs I have created and put them under a single class. My professor has stated I must do this and I have no clue on how to. I am not looking for a hand out here, just some how I can do this quickly and efficiently.

This question already has an answer here: Python object deleting itself 10 answers Python: how to "kill" a class instance/object? 2 answers I am working on a text adventure game written in Python just for fun (to see if I could do it). I am work