Most voted "classes" questions
In object orientation, a class is a structure that abstracts a set of objects with similar characteristics. A class defines the behavior of its objects through methods and possible states of these objects through attributes. In other words, a class describes the services provided by its objects and what information they can store.
Learn more…715 questions
Sort by count of
-
0
votes1
answer52
viewsWhy can’t I instantiate a class from Linq
I’m trying to instantiate the following class from the English library using System.Reflection; namespace System.Linq.Expressions { // // Summary: // Represents accessing a field or property. public…
-
0
votes1
answer57
viewsUnreported variable type error in class constructor
I’m creating a class of ErrorHandler for an API. When creating variables in the class constructor, Typescript accuses that variable statusCode does not have a defined type: interface ErrorObj {…
-
0
votes1
answer41
viewsJava - Bluej giving error return Error found in class
I am trying to make a class to read numbers in full and used this base example. However, when compiling it claims the following error: Error found in class. Someone could help with that mistake?…
-
0
votes1
answer83
viewsWould this class relationship be correct?
I am currently studying about classes, more specifically class/UML relationship and I am doing it in C#. I would like to know if this code I wrote below is the most suitable or if there is a…
-
0
votes1
answer10
viewsInitialization list of members with attributes from another class (inheritance)
I know a member startup list declares and at the same instant initializes such an attribute(s), that’s what I know so far. In the following code: #include <iostream> // std::cout class Foo {…
-
-1
votes1
answer1406
viewsHow do you pass data to a php class via ajax when this is another instance class?
Hello guys I hope you can help me, I’ve been having this problem for a long time I pass my data via Ajax to my class but in the URL do not know how to reach it in a way other than error I tried it…
-
-1
votes2
answers953
viewsIt is wrong to use common variables within a PHP class
Is it a wrong form of POO? Can I only use attributes within my class? Can I use type variables $Variavel, when necessary? I mean, don’t use the public $variavel, or var $variavel, private $variavel.…
-
-1
votes1
answer316
viewsHow do I call a method that is in another class on onclick
Guys I have a simple doubt basically, but I’m traveling on ideas. I have a class called chamada: @Override public boolean onLongPressClickListener(View view, int position) { // opcional, utilize o…
-
-1
votes1
answer399
viewsDoubt about the eclipse [Workspaces Master]
Hello, I would like to know why my eclipse treats a project like [Workspaces Master] And why classes get a question mark. (This project was imported).…
-
-1
votes2
answers100
viewsWhy is calling a method not compiling?
using System; using System.IO; namespace testando { public class pessoa { public void Falar(){ Console.WriteLine("Ola meu nome é ninguem"); } } …
-
-1
votes1
answer327
views -
-1
votes1
answer148
viewsHow to pick up text from a Span with Class [VB.NET]
<span class="odometer-value">0</span> That is the code. I need to take the "0" result and put it on a label. But sometimes you can have ex: 10 (2 numbers) and the code will be: <span…
-
-1
votes2
answers100
viewsProblems in creating class and method
I have the following code: public class String verifyWord(String wordChosen, Scanner reader){ //linha 1 boolean answeredCorrectly = false; int tries = 1; String wordChosen = random.nextInt(); String…
-
-1
votes1
answer4029
viewsWhat is the difference between Class and CSS id?
I’m starting in CSS and I saw these two properties that are similar and perform the same function, so somehow they must have some difference or other kind of function maybe,I wanted to know the…
-
-1
votes1
answer530
viewsYou must declare a body because it is not marked as Abstract, extern or partial
I’m new to programming and I’m trying to use the Class Sendkeys following this link, but when placing the: public static void Send(string keys); the compiler returns me the following error: *Error…
-
-1
votes1
answer33
viewsUsing Methodo within another Methodo with extends class
Hello, I’m learning PHP and I’m having a class inheritance problem. I have a class for connection and another for crud but I can’t use the connection in the crud class. someone can help me with the…
-
-1
votes1
answer307
viewsInput in multiple attributes of a Python class
Hello guys I’m having a question about multiple attributes of functions or methods through the function input. For example: class Pessoa(): def __init__(self, nome, idade): self.nome = nome…
-
-1
votes1
answer280
viewsSearch object by PYTHON class attribute
Good afternoon, I wonder if I can find an object using an attribute Example: class Pessoa: def __init__(self, nome, idade, cpf) self.__nome = nome self.__idade = idade self.__cpf = cpf pessoa1 =…
-
-1
votes1
answer35
viewsWhat is the use of nested classes in python? for which I would use something like that?
I can’t find much python-like, I know you can do that and I know how to do it, but I don’t know why anyone would want to do that, since the inner class is unable to access the attributes and methods…
-
-1
votes1
answer373
viewsInstantiating a class in another constructor in PHP?
I have a class called teacher who is heir to another so-called person, I am trying to instantiate a third class of connection with bank in the method constructing the Teacher class, but it is…
-
-1
votes0
answers22
views(Python) Using a Private attribute in a subclass
My wish is to validate my IF in class B using a private attribute that was done in class A. Nothing more than that, I am aware of some methods to verify an anonymous attribute but still I could not,…
-
-1
votes2
answers175
viewsSetters in an array
I have a array of private integers separated into one class (Obs.: I did so to train the use of the get and of set) and another class that must set values at the addresses of array. This is a…
-
-1
votes1
answer49
viewsI need help defining an IF command
Sometimes when rooting a page I use an error alert appears in the first option, so I have to click on option 2, so I would like to set an IF command,so that when the error alert appears, the script…
-
-1
votes1
answer89
viewsclass call error
Good morning to all!! Guys, I’m going back to dealing with pure php and I came across a mistake half beast, but I’m not knowing how to solve...the error is : C:\xampp\htdocs\PDO\index.php:5 Stack…
-
-1
votes1
answer217
viewsAre there any devaluations of creating a component in React per function instead of Class?
There is a downside to creating the components in React by function instead of class? In the case of Class, the component does not need to have an ID to be accessed internally and change its…
-
-1
votes1
answer51
viewsVariable this.variable does not load the information for search, but for listing uploaded
The code is available at:Github I got the Main Class: static void Main(string[] args) { ControleClienteService controleCliente = new ControleClienteService(); controleCliente.CarregarCliente();…
-
-1
votes1
answer31
viewsError using class to filter by student names
I’m trying to do a function to search by student’s name in the databank. I’m having the following mistake: Notice: Undefined index: filter in C: meuphp test search_student.php on line 7 <?php…
-
-1
votes1
answer34
viewsFailure to update variables
I am developing a project in java, a "farm game" where there are several Tats for the character that is created. When we create a character defenimos which his class, it will influence his Stats. My…
-
-1
votes1
answer117
viewsJavascript - Variable gets Undefined after a function
I have two classes. One that contains the function and the other that matters that function. For some reason I could not figure out the value of the variable after the function is Undefined. First…
-
-1
votes1
answer91
viewsHow to change the attribute of an object received per parameter in a method?
I’m trying to implement a very simple example of using classes in the C++ language. Well, in short, there are two objects (cliente1 and cliente2), which represent two bank accounts. Within the class…
-
-1
votes1
answer45
viewsjava.lang.Nullpointerexception error even with instantiated and initialized object
Good afternoon, In the code below I have already entered the Supplier class within the main Product and even so continues the error below, Can someone help me fix and explain why it’s wrong so…
java classes nullpointerexception instantiate-object initializationasked 4 years, 4 months ago Deivson Bezerra 149 -
-1
votes2
answers58
viewsHow to access vectors of a class in C++
**I am familiar with pure C language because I develop embedded systems and microcontrollers. I am dedicating a lot in the studies of a new paradigm of programming that is object orientation (OOP).…
-
-1
votes2
answers184
viewsHow to access the name and address in the Customer Class, and access description and price in the Java Product Class, being in the Box Class?
I tried to use the following commands: // Requesting the customer’s name name = input.toString(); purchase[i]. getCliente(). setNome(name); // Código do produto a ser comprado, que é o endereço da…
-
-1
votes1
answer376
viewsI’m having an error Cannot read Property 'classList' of null at initialModal, but I don’t know how to resolve
The thing is, I’m a layman at programming, but I’m doing a website, and in this case, all you have to do is pop up, so you can book an appointment at a hair salon. I am following the following video…
-
-1
votes1
answer715
viewsError Typeerror: __init__() Missing 1 required positional argument: 'output_dim' when instantiating convulutional neural network object
I took a course on neural networks applied to natural language processing and now I’m trying to instantiate an object based on the class built in class (with some modifications, because my data is…
-
-1
votes1
answer46
viewsWhy does the list error Object has in the 'checks' attribute occur?
I’m building a program based on a class diagram, and it appears Attributeerror: 'list' Object has no attribute 'checks' when I print the list with the client’s checks class Cheque: def…
-
-1
votes1
answer41
viewsHow to assign a class to one of another Class
In a program I created a class called Player and in it assigns various values, among them there is the value of Itens. In addition to this class, there is another class called Itens with different…
-
-1
votes1
answer37
viewsMysql connection within a class
Hello, I’m having a hard time making a connection to the database. To make the connection I created a class called Conexao and I am using PDO, when I need to make a select, for example, I call the…
-
-1
votes2
answers45
viewsTkinter and class
I am beginner in classes and Tkinter and am having a problem that I think is by little knowledge of me in POO. In the code below, only one label is running, neither buttons nor anything execute,…
-
-1
votes0
answers12
viewsJava Dao class showing the following error:The Resource type Connection does not implement java.lang.Autocloseable
The error is being presented where I perform Try try (Connection connection = getConnection(); And consequently, my Preparedstatement says that the Connection type is not visible in that line:…
-
-1
votes2
answers44
viewsUse the class to add the object itself into a vector that stays in another object
In python I made the following code: class Escola: def __init__( self, escola_nome ): self.escola_nome = escola_nome self.alunos = [] class Aluno: def __init__( self, nome ): self.nome = nome…
-
-2
votes1
answer226
viewsHow to solve several errors of this code?
I typed this program from the book that addresses classes and gave error. How to solve? #include <iostream> using namespace std; class Efetua_calculo{ private: double total; double soma;…
-
-2
votes1
answer208
viewsWhat are DAO, MB, TO, SERVICE, MODEL, CONVERTER and HELPER classes?
In the projects of the company in which I work I see several classes with these appointments, as I am beginner in programming I’m not sure what they mean. Could you clear me of that doubt ?
-
-2
votes1
answer115
viewsAdding an external variable to the php class
Hello folks I am creating a class for user data and would like to know how to insert a sternal variable containing data, for example from the database: class Usuario { public $nomecompleto; }…
-
-2
votes1
answer1928
viewsHow to invoke a method specific to a PHP class?
I created a class Pen which has the following attributes and methods: <?php class caneta { var $modelo; var $cor; var $ponta; var $carga; var $tampada; function rabiscar() { if ($this->tampada…
-
-2
votes1
answer49
viewsabstract class error (invalid new-Expression of Abstract) C++
Well I’m with an error in my 3 daughter classes(dvd,games,car) of a mother class calls video rental. I am trying to use the Factory method and generates the error in the new with the following…
-
-2
votes2
answers87
viewsProblem involving classes, vectors and tuples
Hi, I’m a little confused about the concept of lists and tuples in Python. In my research I noticed that tuple is a "kind of immutable list", but, despite the definition, I still can not…
-
-2
votes2
answers62
viewsDouble appearing dice
I wonder why when I run this code it shows twice the name of the client and employee, and how to solve to appear only once package modelo; import java.util.Date; public class Pessoa { public int…
-
-2
votes1
answer42
viewsArrayindexoutofboundexception error when trying to store values in the array
I am trying, through the Scanner, to take the values typed by the user, to store in a vector and finally, to average the values typed, in the case the average of a student’s grades. However, I’m…
-
-2
votes1
answer41
viewsHow to create an object by requesting data from the user and running from a function?
I created a simple class, I can create an object, but I’m developing a CRUD that needs to create the object from a function. Look at my example: class Funcionario: def __init__(self, nome, cargo,…