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
-
1
votes0
answers40
viewsDifficulty in javascript with the return button of a rotary image banner
Hey, community, I’m new. I come to ask for help from more experienced people regarding the following problem: I want to make a banner of images on a site where images pass every 4 seconds, but there…
javascript function image classes setintervalasked 3 years, 10 months ago Angelo Schuler Piletti 23 -
1
votes1
answer2372
viewsArray and string offset access syntax with Curly braces is no longer supported
how to correct this error? Fatal error: Array and string offset access syntax with Curly braces is no longer supported in C: xampp htdocs POO 03 - METHODS STATIC example-03.php on line 64 the code:…
-
1
votes1
answer50
viewsWhen passed by class, numbers do not come out random
I’m creating a neural network, and now I’m doing the part that would create the population to be trained, but I’m not getting a randomness. I just don’t understand it and I don’t know how to get…
-
1
votes0
answers17
viewsMixin Django Class Based View Python3
Good morning guys: Problem = add a new functionality via a mixin in Jango for a CBV. reason = I want to create two records in two different records. Trying = class CreateUserMixin(object): def post2…
-
1
votes0
answers31
viewsHow to define Custom Loss Function?
Hello, I am trying to make a custom Loss Function through the Keras Functional API and I am having problems with this implementation since I have never done anything like. I want to make a Loss…
-
0
votes2
answers443
viewsDoubt about android using classes
I have the following method implemented and I will use it in various Activities private int dia, mes, ano; String data; String dd, mm; int hora, minuto; static final int TIME_DIALOG_ID = 0; String…
-
0
votes4
answers2802
viewsHow to import classes from your subclasses in PHP?
Basically, I have 3 files located in different directories: diretorio_do_projeto/classes/config.php diretorio_do_projeto/classes/abstract/abstract-dao.php…
-
0
votes1
answer369
viewsInterface vs Class - method visibility
I did a job for school and it’s working perfectly. In the code I have some private methods. I need to create an Interface of this class to hide these private methods or they can be in the same class…
-
0
votes2
answers1505
viewsObject of a class in another Java class
Hello, There is possibility of having the class Object you instanced in the instantiated class? Ex.: (Incorrect syntax, just an assumption) public class Classe2 { // Metodos e vetores da classe }…
-
0
votes0
answers44
viewsProblem in a "self shrinking" class
I asked a question of how to implement this class "self-sealing" but I have this problem when it will start to decrease the text , it is as it truncated the text, then you will be typing it will…
-
0
votes2
answers89
viewsJava code causes persistence problem
After adding the following lines to my Metadicas.java class, a persistence problem arose that was not there before: Lines added: @OneToMany(cascade=CascadeType.ALL) @JoinColumn private…
-
0
votes1
answer993
viewsAccess variables from another iOS Swift class
I have a class Main in my application, and in it I have created the variable cod which receives the value of 0, in this class I also have a sequence of buttons that in them contain the event of…
-
0
votes1
answer133
viewsHow can I read Docblock from a PHP method to a string?
I wonder how I can read the Docblock of a PHP method and turn it into a string. For example, I have the following code: class Stack { /** * @return void */ public function overflow() { } } How could…
-
0
votes1
answer368
viewsError: expected { when creating a class
I wrote the code below, but it’s giving me the error expected { after the declaration of my class public class book(string title, string text){ string _title = title; string _text = text; void…
-
0
votes1
answer35
viewsClass call without success
I have done practically the same way, changing only the names of the variables in another file of the same project. However, when arriving on the line to call the application class to and gives…
-
0
votes2
answers99
viewsDoubt classes c++
Good morning guys! I’m seeing classes and I saw this syntax in one of the examples: vector<line *>line_table; vector<line *>::iterator iterator; line parser * basic_parser; long…
-
0
votes1
answer403
viewsWhen to instantiate and when not to instantiate the object?
Watching a video lesson PHP I learned that you can use a class in two ways, without instantiating the object and instantiating the object. // Forma 1 echo SEO_URL::Strip('Caçador mata leão na…
-
0
votes1
answer300
viewsCalling methods from another class
In case I need to call a method of another class to perform an insertion in the database and I have to pass an object of type Usuario as a parameter Code: protected void onCreate(Bundle…
-
0
votes2
answers201
viewsInterface with the same class name
namespace path; interface test{ public function method(); } class test{ } class foo implements test{ } When writing the above code a fatal error is returned: Cannot declare class path\test, because…
-
0
votes1
answer77
viewsError creating class reference and concatenating methods in Swift
Good night. I have two classes and created an instance referencing the parent class calling its method and the same does not run and shows the following sentence: "Swift Expressions are not allowed…
-
0
votes1
answer425
viewsWhy isn’t the object being instantiated?
I have a Bean class (Casa.java) public class Casa{ //atribubutos private String parede; public Casa(){ } //getters e setters public void setParede(String parede){ this.parede = parede; } public…
-
0
votes2
answers514
viewsHow to pass the value of a variable through a button to another class in Swift
I have a login screen, with the e-mail and password fields. I need to use in another viewController the email that was used to log in to the system. But I cannot pass the e-mail typed in…
-
0
votes1
answer2095
viewsCatch the index of the array in the foreach
I have the following class CarrinhoDao.php creating an array of objects from Carrinho.php that creates a class object Produto.php I’m making a foreach in the resulting array: <?php require_once…
-
0
votes2
answers111
viewsHow to reuse data in a class without having to repeat this data?
How to reuse $dados, $key and $postFields in all methods without having to repeat this data every time within each method? Yes, these variables will always have the same values. class AllImoveis {…
-
0
votes0
answers309
viewsClass display php image
There is the possibility to display an image through class methods without needing an external file to not generate header conflict? I created a class where to depend I call an image in a protected…
-
0
votes2
answers488
viewsWhen should I create a class?
I know it sounds like a really silly question, but I’m starting now in the world of programming (focused on mobile). When I create an app it gets all the functions within the Activities, then I…
-
0
votes1
answer140
viewsDoubt about data return in PHP POO
I’m learning about object-oriented programming in PHP, classes, hierarchies and so on. Reading a few topics right here on stackoverflow I found the solution to my problem with the user control…
-
0
votes1
answer533
viewsIndefinite reference in C++
I’m studying c++ and found a problem when working with object orientation, I followed some tutorials but it didn’t work. Bill. h #ifndef CONTA_H #define CONTA_H #include <string> using…
-
0
votes1
answer46
viewsClass Row with image
I’m trying to put in a row three columns, where the first one will have an image and the others should have the text aligned below. <div class="row" style="background-color: #ffffff"> <div…
-
0
votes0
answers49
viewsError php 5.4 starting class made in php 5.2
Fatal error: Class 'func' not found in C: xampp htdocs painelnovo classes config.php on line 15 config.php line 15 include_once "class.func.php"; $func = new func; class.func.php <?php class func…
-
0
votes1
answer256
viewsDictionary in python
Good morning! I’m having trouble breaking down the information and dictionary in python. My dictionary is a Biopython-generated dictionary like the one below: {'LastUpdate': '2016/11/11 04:34',…
-
0
votes1
answer609
viewsTemplate class, include header and footer
Hello, I had already posted here some time ago about my templates class, but I decided to a modified one, because every time I want to edit a menu for example, I have to edit in all my files. This…
-
0
votes1
answer40
viewsHow to list static properties (Shared Property) equal to System.Drawing.Color
I have a structure called Servicos and in it I have some static properties. Public Structure Servico Public Shared ReadOnly Property Instalacao As Servico Get Return New…
-
0
votes1
answer67
viewsHow do Overload the assignment operator into a class that contains vector?
I would like to do the allocation operator’s Overload (operator=), I know I have to reserve memory, and copy data from one to the other, however I do not know how to copy one vector to the other…
-
0
votes1
answer48
viewsCan I use a function in the declaration of an attribute in PHP?
Hello. You can do something like: class Net { public static $ip = getenv("REMOTE_ADDR"); } Take the return of a function and assign directly in the property? Or create a variable outside the class…
-
0
votes1
answer539
viewsClass c++ has no Member named
I’m starting to develop a list list to represent a graph in memory. I’ve only done that first part and I’m getting the following mistake: class std::vector<No> has no member named 'getId'…
-
0
votes1
answer872
viewsSession variables $_SESSION vs class variables in PHP
I wanted to know the pros and/or cons of using session variables on class constructor or even within class methods. Let’s say I have the following class: class minhaClasse { private $arrEnvSettings;…
-
0
votes0
answers97
viewsClass Tdbtext not found
Good morning, my friends. I am having problems with a program, because every time I start one of the options, it returns me an error of "Class Tdbtext not found', and the package that contains this…
-
0
votes1
answer411
viewsWhat is the difference between parameterized class, multiobjects and Collections?
Well, I know the concepts of each one. I just don’t know how to tell them apart. For example, a parameterized class is a class that is used to define other classes, and a Collection can be…
-
0
votes0
answers424
viewsHow to Fix Class Registration?
I am trying to call an external application to my application and when I call this application I get error following. Retrieving the COM class Factory for Component with CLSID…
-
0
votes1
answer762
viewsHow to install the Rain TPL library?
Could someone show me an example? Yeah, I put it here in mine index.php this way, but, I believe it is outdated. With the current version, I believe it should be different, because it did not work…
-
0
votes1
answer382
viewsTake a class that has a certain interface implemented in Generics
Hello. I want to do something like metodo(Class<? extends ClasseAbstrata> classe), only that of an abstract class, I want to use a interface, but I’ve moved on from extends for implements the…
-
0
votes1
answer591
viewsAccessing a file using Properties
I am working with a method that takes as argument an object from the Properties class: public static void main(String[] args) { //Properties props = new Properties(); Properties props = new…
-
0
votes3
answers1188
viewsHow to pick a specific element between several of the same class via jquery?
Guys, this is probably something extremely simple but I’m struggling to solve: Assuming a code word <input type = "text" class = "campos" value = "texto1"> <input type = "text" class =…
-
0
votes2
answers121
viewsI can’t remember some concepts about class arrays
I’m wondering. 1 - Is my reasoning correct? For example, if I put Funcionário funcionario within the class Empresa, means that: "In the company has employee". Correct? 2 - How do I define a class…
-
0
votes1
answer92
viewsIs it a good choice to start a project with Diagram use cases, then class diagram?
I have an idea of software, but I don’t know if I should go directly to the class diagram and then the coding or if first of all I should use a use case diagram. I will work on this software alone.…
-
0
votes1
answer196
viewsError declaring an interface to the class in PHP?
I’m having trouble declaring a interface to a classe in the PHP where I’m encapsulating the entire program with namespace. I created a interface calling for Yargle in the directory Cnab\Remessa and…
-
0
votes3
answers405
viewsHow to import all Static variables from another class?
I have two classes, A and B. The class A need to access all existing static variables in B. How to make this import? I found a lot to do with get, however it does not seem to be that. I am beginner…
-
0
votes1
answer48
viewsJasperreport - Passing Objects to report column
I have to take the dice from the following field : venda.getVendacardinalidades().get(0).getUsuario().getPessoa().getNome() And put this value in a report column, how do I do that: I was trying to…
-
0
votes1
answer80
viewsHow to Save All User Lists?
Hello is my first question here, I would like to ask a question. I would like to create a List that stores the user’s name, email address, password. Could someone help me? I thank you in advance,…