Most voted "objects" questions
An object is any entity that can be manipulated by commands in the programming language. An object can be a value, a variable, a function, or a complex data structure. In object-oriented programming, an object refers to an instance of a class.
Learn more…360 questions
Sort by count of
-
2
votes0
answers93
viewsJava script does not recognize object
I’m having a problem where my Javascript code when I started IE11 my object core is not recognized, however in any other browser works normally, which might be causing this loading error. Core code…
-
2
votes3
answers148
viewsTransform Jsonarray into Class Object
I am consuming an API in my application that returns me an array of names, I created a class to assign each name to 1 instance but I am having problems to take this Jsonarray and transform into…
-
2
votes1
answer193
viewsWhat’s the difference between Dynamic and Object
What’s the difference between using Dynamic and Object on Dart? For example, functions that do not know the type of return: Future<dynamic> getQuery ou Future<Object> getQuery To make…
-
2
votes1
answer256
viewsInstantiating an object in the same constructor class is "inelegant"?
It is always seen as a good practice of programming if we create a class for the object, where we have the constructor and make the methods and another class where we instantiate several objects of…
-
2
votes1
answer40
viewsNull Arriving Object List in Controller
I have a question and hope that someone can help me. I am not being able to send objects from my View to the controller. Every time it comes, it’s empty. I’ve tried a lot of things and I can’t seem…
-
2
votes2
answers147
viewsObject Array (not objects) in Java - How to use
Hello, I have the following task to do: I have three types of employees (Commissioned, Salaried and Hourly) and I have to add them to a list (ArrayList) to manage them. ArrayList<Commissioned>…
-
2
votes1
answer58
viewsHow to catch a json object with match
Good morning, I have a json with the following format: { "code_name_1001": "Antônio", "code_name_1002": "Luis", "code_name_1003": "Alice", "code_name_1004": "Julia" } my doubt is on how I can get…
-
2
votes2
answers73
viewsHow can I get an Array’s Index number?
How can I acquire the number of elements that has the value of day of 5. This would have to return me another Array, for the manipulation to become more dynamic. This is the Array I have based on:…
-
2
votes0
answers36
viewsWhat is the difference between defining an object property as a function or already passing the direct parentheses?
What is the difference between store and store2 properties? const MyObject = { store1(req, res) { console.log(req, res) }, store2: function(req, res){ console.log(req, res) } }…
-
2
votes1
answer130
viewsList containing only the last element in Python
I’m going through a text file and putting its contents in a list of objects, in which each object contains two "string-like" attributes: word and meaning... The problem is that after I go through…
-
2
votes2
answers141
viewsPython value and reference
Disregarding the way it was made, this is a square matrix transposition code, the person who did came across the error in assigning the values in the latter for and neither I or he could solve: when…
-
2
votes2
answers53
viewsHow can I exchange elements of a string using the values of an object as argument?
I have this code: const operators = { plus : '+', minus : '-', multiplied : '*', divided : '/' } let question = 'What is 4 plus 6?'; let matchs = question.match(/\d|plus|minus|multiplied|divided/g);…
-
2
votes1
answer63
viewsHow can I extract multiple objects from within an Array
I got a problem, I got a problem Array that returns me another Array with this group of objects inside: let array = [ {description: "Auto", amount: 15000, date: "17/02/2021"}, {description: "Auto…
-
2
votes1
answer47
viewsHow to verify if object has specific property without the operator "in"?
Some browsers do not support inputMode, like Safari. So to then mitigate the situation, I would have another behavior if the inputMode existed or not. Searching I found the operator in: if…
-
1
votes1
answer286
viewsHow to detect collisions using Slick2d?
I would like to know how I can detect collisions between objects using Slick,have some useful example? I’m making a simple little game where 2 squares are moving on the screen and if the character…
-
1
votes1
answer28
viewsAbout Object and Extensions
I am now starting in Javascript I am learning through websites. I went to an excellent site (http://tableless.github.io/iniciantes/manual/js/objetos.html) and so far everything was fine. Except that…
-
1
votes1
answer47
viewsUses existing paraments in a second-level parentNode
I have the following object as an example: var teste = { config : { dir: "myDir", type:"myType" }, fn : { foo : function(){ console.log(this); //retorna o objeto fn }, bar : function(){…
-
1
votes1
answer249
viewsWhat is Prevayler for?
I’m studying Prevayler in college, but I do not know the real use, or why to use, looking on the Internet I found several discussions but nothing that really explain what it is for. Would it be to…
-
1
votes3
answers752
viewsComparison between objects through loop, If and Else?
I’m beginner in java and I’m having doubts in comparing objects by means of loop. I am developing software for a video rental company with Pattern MVC (Model-view-controller) design and I want to…
-
1
votes1
answer151
viewsArray receiving two objects
I have two objects and wanted to create an array this way => [{"loj_codigo":2,"loj_fantasia":"teste 1"},{"loj_codigo":1,"loj_fantasia":"teste 2";}]} I am receiving the following objects =>…
-
1
votes1
answer672
viewsStatic method with object as parameter
I am creating a very simple system for enrolling students. I took a class Aluno as follows: public class Aluno { private String nome; private String matricula; private String curso; private int…
-
1
votes1
answer774
viewsSpecific Treatment for Groups of Objects inserted in the VBA Toolbox (Excel)
Due to repetitive actions with groups of objects that I create to work as if they were a single object, I grouped some of these objects (right-clicking and selecting group...), and dragged into the…
-
1
votes0
answers365
viewsHow to use PHP Objects and Mysql Transaction Control?
I have a database with some tables, and I created a class for manipulation for each table of the bank, an example of them is a class for orders and another for itensPedidos. Each class manipulates…
-
1
votes1
answer538
viewsBrowse Objects from Objects
How to Browse JS Objects? Like, I got a Json { children":[ {} ] } the question is, that sometimes there are objects inside objects and sometimes not, inside that Children, I can have another…
-
1
votes2
answers106
viewsReturning an object. Any Smell code here?
I thought of the following public method: public RespostaDeArme armar(); The class RespostaDeArme would be so: public class RespostaDeArme { private final ResultadoDeArme resultado; private final…
-
1
votes1
answer61
viewsWhen I am instating a class I need to perform a 'delete' after using the object even if the class has a destructor?
If I instate a class and Gero an object from it obligatorily I have to displace the memory of that object at the end of its use, right? But if the class that originated my object has a destructor it…
-
1
votes1
answer146
viewsScroll over an object and its properties
Supposing I had this piece code: let obj = { lang: { hi: 'Olá, mundo!' }, engine: { functions: { init: function () { return this.lang.hi; } } } }; console.log(obj.engine.functions.init()); How I do…
-
1
votes2
answers457
viewsCount and compare number of keys and values between objects
I am using Javascript objects to transcribe the interface of an app, however, I would like to create a tool for collaborative transcription but do not know how to proceed. Simplistically the object…
-
1
votes1
answer50
viewsReturn sum objects of an array in one
Next, I’m a designer and I’m slowly learning javascript. One of the things I have the most difficulties with is objects and arrays, so I’m focusing more on that now. I have an array with 4 objects…
-
1
votes1
answer438
viewsC# Calling an object from a string
I wonder if there’s a way to call an object from a string. Here is an example: public class Butao { public string _Name_; public float _Price_; public Butao(string name, float price) { _Name_ =…
-
1
votes1
answer197
viewsArray has values, but its length is zero
I need to iterate on this array, however, although it is not empty the length of it returns 0 as you can see, someone knows the reason? The scenario is as follows: I am receiving JSON data from an…
-
1
votes0
answers301
viewsFor Each In . Control GROUPED Shapes for excel
hello would like to make a For Each In . Shapes "those shapes" but they grouped I was able to assemble with them disaggregated, but grouped it seems that the procedures are different what I’ve…
-
1
votes2
answers84
viewsComparing two objects and copying conditionally
I have the following classes: public class Pessoal { public int ID { get; set; } public string CPF { get; set; } public string PIS { get; set; } public string NOME { get; set; } ... ... ... } public…
-
1
votes2
answers80
views -
1
votes1
answer1315
viewsTransform object into array keeping the index
Good afternoon Friends who can help me? I have this Object Array, I needed to turn this Object into a list more keeping the Input as it is Using Map it changes the Dice: I needed then to access each…
-
1
votes1
answer1945
viewsAccessing data from a js object
I have the following JS object displayed by the console.log I can only access the status property of the object itself, but I need to access the status property that is within the value object and…
-
1
votes1
answer1531
viewsHow to access an object in which the key is a number?
I have an object whose key to a property is a number, I can’t access that data using dados.1.TIPOPROCEDIMENTO. How can I do that? const dados = { "1": { "TIPOPROCEDIMENTO": "Humanas", "DESCRICAO":…
-
1
votes2
answers147
viewsMake data written by the user be stored in a JS object
I have this code and wanted to know how to make the user can press a button and, from that, store the data requested by the page in the JS object and, after that, display the message written in the…
-
1
votes2
answers183
viewsInstantiated object does not appear in function
Hello, I am creating a Java project using Eclipse with windowbuilder. Inside this project I have Jframe with the objects, jbuttons, jtextfields, jformattedtextfields, etc... I have all these objects…
-
1
votes1
answer142
viewsHow to instantiate objects using literal object syntax?
I have a question maybe a little stupid, but come on, in Javascript, I can create an instance of an object declaring like this, let’s go in an example of a game, where I have to instate bullets to…
-
1
votes2
answers1136
viewsPerform search inside javascript object and return value
i need to do a search inside a javascript object that brings me the sku according to size and color, vcs can give me a light? Example: I need to insert in a variable the product sku that has the…
-
1
votes1
answer2505
viewsChange attribute of an object array in the state in the application
to try to make an attribute of one of the objects in an array of objects switch between true and false follows code: Initial state: constructor(props) { super(props) this.state = { post: [{ nome:…
-
1
votes1
answer229
viewsComposition of objects in javascript
I’m studying a little more javascript here and I’ve come to a problem: I have an object called player: let Player = function () { this.name = 'player'; } Player.prototype = new Sprite();…
-
1
votes2
answers489
viewsWhat are the differences between Value Objects and entities in object orientation?
I would like to know the differences between the concepts of Value Objects and entities in object orientation. NOTE: The question is not whether the use of these concepts are good or not, the doubt…
-
1
votes0
answers59
viewsMount object tree
I need to Mount a php object tree, where I have for example: id | parent_id | nome | telefone | email from the past id I search and mount all the tree from that idPai (int) 0 =>…
-
1
votes2
answers66
viewsReturn data from a subobject
Below is what I implemented until then: public class Interface { private List<Usuario> usuarios = new ArrayList(); private List<Tarefa> tarefas = new ArrayList(); Menu menu = new Menu();…
-
1
votes1
answer652
viewsHow to "type" nested objects? (Typescript)
I have the following example object: const types: any = { car: { full: 'fullString', empty: 'emptyString' }, plane: 'myString', }; I’m trying to get a guy on types but the nested object (car), He…
-
1
votes1
answer435
viewsNgfor inside another Ngfor Angularx
I am trying to run a loop to show the values, respectively for each user, but with ngIf nothing appears, as I put here in the example, and without ngIf are shown the two values for the two users,…
-
1
votes3
answers392
viewsHow to use reduce in an object array in React
import React from 'react'; const App = () => { const fruits = [ { name: "banana", cor: "yellow", price: 2 }, { name: "cherry", cor: "red", price: 3 }, { name: "strawberry", cor: "red", price: 4…
-
1
votes1
answer117
viewsRemove object from array
I have the following array called listDeTipoAtendimento 0: {tipoAtendimento: "ESTUDANTE", tipoServico: "ESTUDANTE", atendente: "José da Silva"} 1: {tipoAtendimento: "Gestante", tipoServico: "teste…