A template for creating new objects that describes the common state(s) and behaviour(s).

learn more… | top users | synonyms (1)

0
votes
0answers
5 views

Using type of property as second information in ECMASCRIPT languages

I saw this in some PHP scripts around the web and started to use it myself, but never in JavaScript or ActionScript. Now I'm working on an object oriented application and this strategy seems to be ...
-3
votes
4answers
17 views

Creating a new project without the same classes?

This is most likely a rather simple/stupid question. If I create a new project in eclipse it extends all the classes I have in the previous project. The problem is the project is overloaded with so ...
0
votes
3answers
60 views

Change existing DIV from a CLASS to an ID

Is this possible? Or is there a way to tack on and ID to an existing div? This is my code. I can't get the code to work using classes, but I found when I used getElementById and changed the div to an ...
0
votes
2answers
14 views

PHP Call a databaseclass inside a class

im verry new to classes and PDO. I've searched for hours and hours on google to find a solution for probably an easy problem. The thing is. I have made a class to connect to my database. Then, i made ...
-1
votes
1answer
21 views

Preferred JavaScript Idiom for class definition

What is the preferred idiom for defining a class in JavaScript? I could define a constructor function for complex numbers as follows: function Complex(real, imag) { this.real = real; ...
0
votes
4answers
43 views

Accessing variables in a class from another class

I have many classes, call them Class1, Class2, ..., and so on. Each of these classes has two variables, TestDictionary and TestListDictionary, as follows. Each of these classes also call a method ...
-1
votes
1answer
18 views

Constant instance in a static class

I am tying to make a Global variable class, here is my code public static class GLOBALVAR { public static const Color DIFFRENCECOLOR = System.Drawing.Color.LightSalmon; public static const ...
0
votes
1answer
16 views

how to print to screen a vector?

I'm implementing the show Deal Or No Deal, there's a class 'box' which in the main file i used to store the random values of the boxes and than, i saved each box in the vector. im trying now to print ...
-1
votes
2answers
61 views

Public member function not returning values … am I missing something?

I'm new to C++ (and OOP in general). I'm writing a class that performs some mathematical operations on 2 polynomials. Here's my code: #include "stdafx.h" #include <iostream> #include ...
0
votes
6answers
50 views

Object is not able to access the method defined as public

Here is another dumb question from me.I just read that if you define any method with "public" access , you can use that method in any other class if both the classes are in the same package. I tried ...
0
votes
1answer
21 views

Creating and running multiple Java windows using one class

Below program will create 2 simple windows where we can type some text, and it will be shown in both windows' display screen. I created a Class to generate UI. However, when I use the same class to ...
0
votes
2answers
30 views

calling child class method from parent class file in python

parent.py: class A(object): def methodA(self): print("in methodA") child.py from parent import A class B(A): def methodb(self): print("am in methodb") Is there anyway to ...
4
votes
2answers
49 views

Make a Python class throw an error when creating a new property

Let's say this is my class: class A: def __init__(self): self.good_attr = None self.really_good_attr = None self.another_good_attr = None Then a caller can set the ...
1
vote
1answer
26 views

How to unpack first-class module to module for object with class declaration (OCaml)?

I have: module type A = sig val b : int end This code is valid: let c d = let module E = (val d : A) in object method f = E.b end and this: let g (module E : A) = object ...
0
votes
4answers
49 views

How to run a class' method using thread

If I do the following, I will be able to create an object as a thread and run it. class ThreadTest { public static voic main(String[] args) { HelloThread hello = new HelloThread(); ...
0
votes
2answers
34 views

Custom exception class - weird behavior

I've created a custom exception class testException. throw creates a testException object which upon creation receives the desired name of the exception. When a testException is caught (by ...
30
votes
9answers
1k views

Why does this Java code output that?

I do not understand the output of this code: public class StringDemo{ public static void main(String args[]) { String blank = ""; String comma = ...
0
votes
3answers
67 views

How do I call parent class copy constructors?

I came across a little problem with the inheritance of copy constructors. Copy constructors of parent classes are not called when I try to copy a class. Here is an example program which sums up the ...
-1
votes
2answers
26 views

Expose a field from a Class and add a property?

I have a silly problem and I am possibly going about this the wrong way. I want to add a property to a class to change a field. I am thinking that this is not possible due to the Class level of ...
-2
votes
2answers
30 views

I am getting this error “An unhandled exception of type 'System.ArgumentNullException' occurred in System.Core.dll” [duplicate]

I need to pass values into zeiresponse.TEnrlbp , which is a type "ZetEnrlbp".Any help would be appreciated.Thank you ZEIsuCirroCreateBpCaResponse zeiresponse = new ...
0
votes
0answers
35 views

How can I find what is giving access to a class?

I am using VS2013 C# I have a class that I want to access inside of my editor, it is available in another forms code using MyProject.Property.Color; but in the editor form where I need to use a ...
-4
votes
0answers
33 views

Program wont compile with `template <class X>` preceeding `main` [on hold]

I am working on a small project with 2 header files, 2 cpp's defining the header files, and one driver cpp. Within the first header file I have a class called numberOne which acts as a template for my ...
0
votes
2answers
42 views

Python - return all self.* variables modified by method

Is there some way to return all the self variables that have been modified by a method in python? For example, I have a method that modifies twenty self variables and want to return self.variable1, ...
-1
votes
3answers
26 views

Android: How to create a reusable class for several layout screens to Enable/Disable Wifi Programmatically

I want to create a reusable class for several layout screens to Enable/Disable Wifi Programmatically and other tasks . Below is my code. But getSystemService do not work without extends Activity. So ...
0
votes
2answers
60 views

How to make public members of a class private?

I'm brand new to programming (in general) and C++ (in particular). I'm trying to take the following public member variables and make them private: int *coeff; int order; Unfortunately, I'm seeing ...
0
votes
0answers
34 views

Need some feedback on my application design [on hold]

I am doing a small project (homework) about an Animal Care Center, so far in my practices I have done well enough but sometimes I tend to add more than necessary or less, and I this time thought I ...
0
votes
1answer
38 views

C++ Pass a argument through a class with array index

Is there anyway I can pass a argument through a class like below for example. class cat { public: void dog(int ID, const char *value) // int ID I'd like to be the index array it was called from? ...
-1
votes
2answers
36 views

What happens when a method is not declared as public, private, or protected? [duplicate]

I've been learning OOP in PHP and I'm wondering what happens when you instantiate a class with functions that are not declared as "public", "private", or "protected"? Here's an example: //file1 class ...
0
votes
1answer
35 views

Convert a Variable To a Propery Variable Using Reflection

I am trying to convert Public Class TestClass Public FirstName As String End Class To Public Class AnotherClass Public Property FirstName As String End Class I wrote a ...
1
vote
2answers
31 views

How can I make a property of a class case-insensitive?

In CoffeeScript, let's say I've got the following: class Greeter message: -> greeting = switch @gender when 'male' then 'Sir' when 'female' then 'Madame' ...
0
votes
1answer
35 views

super structure/class that contains other classes, that can be easily passed around

Is this data stucture possible using classes and what is it called in Python? class AwesomeThing(): class Tv(): tvid = "" queue = "" class Remote(): ...
-2
votes
2answers
41 views

How to delete an item in an array while using a Class Template?

//I'm trying to delete "GoodBye" from the Remove function and then print a list with it missing. //I'm getting an error saying //Error 1 error C2440: 'delete' : cannot convert from 'std::string' ...
0
votes
0answers
7 views

NetBeans - Import package or use the direct path

I doubt that the performance of netbeans in the analysis of the source code, as the performance which option is best? import classes or packages? ex: package test; import javax.swing.Timer; public ...
0
votes
2answers
25 views

OOP php new class creating, how I can do it?

Why my class takes to me the following error: Parse error: syntax error, unexpected 'new' (T_NEW) in file.php on line 6 class mongowork { private $mongo = new MongoClient(); ...
-1
votes
3answers
40 views

Not all control paths return a value for Boolean?

// I'm using a boolean function and it returns a false and true, but the main isn't //picking it up. The my_string.Is_full and my_string.Is_empty are suppose to say "it is not //full" and "it is ...
-3
votes
0answers
15 views

dxEncryption convert source from vb.net to c#

I need help for this Encryption Class. Because I am upgrading my program to C# from VB.NET. then this class is an open source code and i forgot where did i got this. so can anyone convert this class ...
0
votes
3answers
34 views

How do I set static variables in C++ classes? [duplicate]

I have a class like this: class example { public: static void setStaticVar() { example::var = 1; }; private: static int var; }; But it gives me linker errors and I have no idea why. I want ...
2
votes
1answer
52 views

Implementing create function for Interface class in C++

Reading Effective C++, Item 31 describes two methods for minimizing recompilation time by having clients use one class which only provides an interface to functions they can call. This class refers ...
1
vote
0answers
30 views

Moving from document ready to js file class/object

I was doing a lot of mocking of a layout page. I wrote lots of javascript using $(document).ready in the header to test. $(document).ready(function () { $('.errorPopup').hide(); ...
2
votes
0answers
38 views

Two instances referenced to the same object [duplicate]

I have a class that looks somthing like this: class A(dict): info = {'num': 0} def __init__(self, **kwargs): self.__dict__.setdefault('info', self.info) When I'm creating instances of this ...
0
votes
4answers
58 views

Setting a class variable to string in php?

I have tried to search the web for this but cannot find a solution for my problem. I am implementing a shoppingcart that will send some variables to PayEx payment, but I am struggling with some Class ...
0
votes
1answer
25 views

Application Error: ClassNotFoundException - TTT.jar - Java Applet

I made a basic Tic-Tac-Toe game and I want it to be played on my website. Currently it is not up but just on my computer. So I am testing it. I used an applet code: <applet code="TTT.jar" ...
0
votes
3answers
50 views

List and Classes in C#. Trying to get count of two list of different classes type

I am having two lists, ListA and ListB. The type of ListA is classA and the type of ListB is classB. I have one variable which chooses one of both classes. From both, I need to get the count because I ...
5
votes
2answers
154 views

Why is no empty argument list required inside this class definition?

When instantiating a variable that has the type of a templated class using only the standard type arguments, the syntax looks like this: template<typename Arg = int> class Templ; ...
2
votes
1answer
22 views

Copy MPMoviePlayerController to otherclass

I have Following senario I have MPMovieController in on of my class and it is playing fine . On buttun click i want to move that MPMovieController to other Class and want to add it on that class's ...
-2
votes
4answers
48 views

dice game in java (calling from a class with a constructor)

I'm trying to make a dice game with a dice that can give a random number between 1 to 6. I have a class that is called Die which consist of one constructor and two methods. The constructors main ...
0
votes
2answers
19 views

PhpDoc for interface and class implementing interface - difference

The question is quite simple - how should I differ phpdoc for interface and for class implementing interface? Should/Can they be the same or maybe interface documentation should be as general as ...
0
votes
1answer
58 views

How to read recursive List in java

I can not read a recursive list of items. I have a tree of categories, each category has children, which in turn can have children (do not know how many). This is my class: public class Category ...
0
votes
2answers
34 views

2D Array of Pointers -> Classes

I am having problems with my constructor in class World. I created a 2D array with pointers where each entry in the array is of type Organism, hence the line of code: Organism* grid[20][20]; When ...
0
votes
2answers
60 views

Java - Understanding classes, methods and parameters

So I am super new to programming in general and I'm only a few weeks into a beginning summer course on Java and I'm super confused on this assignment for a simple java calculator that we need to use ...