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
-
1
votes1
answer37
viewsWhy is Math type Object in Javascript?
In literature Math is the type "object", however, the concept of object in its structure is of the key/value type. And I do not see the object structure in Math, need to understand better.…
-
1
votes1
answer158
viewsInsert object from a Linkedlist to a Linkedlist from another class
I have two classes in my project: Cars and Cars. At first, I have a Linkedlist stated as follows: private LinkedList<Carro> carros = new LinkedList<Carro>(); Then I have methods of…
-
1
votes2
answers75
viewsHow to modify an object array through a condition?
I have the following object array: let items = [ { carro: { title: "Gol", description: "Gol quadrado", active: true, }, isVisible: true, }, { carro: { title: "Gol Filho", description: "Gol…
-
1
votes1
answer63
viewsReturn only an attribute of an object?
I would like to know how to get only one object attribute ... const person = [ { name: 'Jane', age: 55 }, { name: 'Rafael', age: 23 }, { name: 'Carolina', age: 19 }, { name: 'Bob', age: 47 }, {…
-
1
votes1
answer2449
viewscom.google.gson.Jsonsyntaxexception: java.lang.Illegalstateexception: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
Hi, I’m new here and I’d like a hand. I happen to be developing a work of distributed systems in which the client is in Java and the server in Python. For there to be communication between the two,…
-
1
votes2
answers352
viewsTaking an element inside an object
Hello, how do I get the "name" element, being that it is within "show" and the whole "show" is within "0"? (NOTE: If the nomenclature is wrong, I’m sorry, I’m beginner in JS) 0: score: 31.86105…
-
1
votes1
answer77
viewsObject and Like Array Search in Javascript
I’m trying to get the value of a key inside an object inside an array, I can bring all the values of the key detyerminada, what I couldn’t get because I didn’t understand it properly was to bring…
-
1
votes3
answers680
viewsTraversing array of objects
Good night. I have an array of an object and would like to take two values: object(OrgaosJurisdicionais)[17] protected 'data' => array (size=3) 'id' => string '3' (length=1) 'nome' =>…
-
1
votes1
answer62
viewsHow to add an array of objects on a grid line of a java Jtable
I have a code snippet that works as follows: protected void listaTodosRegistros(boolean bAberturaConsulta, JTable tbGrid, boolean bFiltraTodos) { DefaultTableModel modelo = new DefaultTableModel();…
-
1
votes1
answer70
viewsPassing parameters using primitives or an object containing the fields?
When creating the signature of a method, what would be the best design option for passing parameters? Is there any good practice that addresses the signing of methods? What would be better? For each…
-
1
votes1
answer400
viewsI’m having trouble compiling a java code using Packages on linux
I don’t know exactly the command to compile a java file on linux that shares the same package. I tried to follow this tutorial:https://www.webucator.com/how-to/how-compile-packages-java.cfm but the…
-
1
votes2
answers82
viewsError when referencing an object’s value in another javascript object
I have the following variable with several objects inside: const dados = { estudouNaFaculdadeAno: { metricas: { ano: [], invalido: { num: 0, palavras: [] } } }, estudouNaFaculdadeCurso: { metricas:…
-
1
votes1
answer104
viewsC# Error When Deserialize Json for Object
I’m making a mistake when I take the return of a REST service and try to deserialize to a C object#. The REST Service returns me to the following structure(json): { "Marcacoes_Ponto_Response": {…
-
1
votes1
answer101
viewsTransforming object array into a specific data structure
I have some information saved in the database that I would like to display in a structure defined by me. When making a SELECT * FROM table an array of information is returned, as shown below. I…
-
1
votes0
answers65
viewsAre there arrays in JS, or are they just 'hidden objects'?
My teacher brought the question atoning, and he gives a lot of emphasis to the subject. After all, there are array[] in fact on Javascript or are they mere disguised objects? As I am starting, I…
-
1
votes1
answer369
viewsSave an object inside an array without overwriting the old javascript
I’m learning javascript and I’ve already broken my head a lot with this,I looked at several forums and questions here on the site but I couldn’t solve the problem.I want to take the value of two…
-
1
votes1
answer37
viewsReduce to the Object?
I’m making a code here, with the following object: { path: 'mtw', return: 'hi', obj: { path: 'he-mele-no-lilo', return: 'hi', obj: { path: 'hawaiian', return: 'hi', obj: { path: 'swiss', return:…
-
1
votes0
answers37
viewsJavascript: method as object builder?
I would like to create a method within an object, but it assigns the properties to the object itself: Game = { personagens: [] }; Game.Personagem = function(obj = {}){ this.nome = obj.nome ||…
-
1
votes1
answer62
viewsHow to take the values of the property of an object created with a constructor function and group in an array?
I have these two construction functions that should create three passengers and a wagon and I need to create a method that when a passenger is added to the wagon he adds his name to the Passenger…
-
1
votes1
answer58
viewsProblems instantiating objects in python
I’m new to programming, but I just came from Java and I’m migrating to Python.. To start I created a simple Person class with 3 attributes and tried to instantiate it to see the syntax, but I just…
-
1
votes2
answers170
viewsHow to place two arrays inside a single loop of repetition to populate an object?
Based in that and in that reply, I am creating an instant search box that returns results based on the items of two arrays with elements p and a of certain classes present on the page. The idea is…
-
1
votes1
answer85
viewsAbstract class to access elements from an object collection
I’m doing my first project on C#, I’m creating data from a multi-object JSON file that contains basic information from a file (Filename, Datacreation, Size). Filing cabinet jsonArquivos.json: [ {…
-
1
votes1
answer47
viewsReturn array object with condition
I have a json where I need to return the object based on a condition. I need to return the corresponding object to the artist selected by the user, being it selected by name or nickname. The search…
-
1
votes1
answer25
viewsObjects with equal name fields using scatter notation (spread Operator)
Considering two objects (user and unit): var user = { nome: 'Nome aqui', idade: 45 }; var unidade = { nome: 'Nome da unidade', idade: 22 }; // Spread Operador var dadosGerais = { ...user, ...unidade…
-
1
votes2
answers46
viewsHow to obtain a single object from the comparison of the smallest of the values between an array of objects?
I’m unable to make a selection that looks for which is lower price and also the shorter delivery time of a JSON. I need to return the complete object. Something like: { id: 2, price: 10, available:…
-
1
votes1
answer227
viewsError unstructurating value in function: Typeerror: Cannot read Property of Undefined
I would like to understand why this mistake happens: Uncaught TypeError: Cannot read property 'name' of undefined at logName (<anonymous>:1:24) at <anonymous>:5:1 Code: function…
-
1
votes1
answer76
viewsBest practice of creating object from reduce
I wrote an algorithm using reduce which creates an object with two other objects inside, however I found unreadable. In search of inspiration to refactor the algorithm I ended up searching in…
-
0
votes1
answer1899
viewsAccess attribute of a JS object using the key of another attribute
I’m trying to get the value inside a given object using the key of another object: Ex: I have the objects: var obj1 = { id:'gh73f'} var obj2 = { gh73f : 123, h39sg : 764, c9wer : 921 } I tried to:…
-
0
votes1
answer1021
viewsHow to Build Object Array
I’m trying to build an Object Array in Javascript, but the result is not as expected. That’s how I’d like it to stay: But this is how it’s getting: That’s the code I’m using: var wo = new Array();…
-
0
votes1
answer77
viewsExpand Object to Xml
I am using Expands Object (c# VS 2013) to read a complex xml file. I now need to read this Expands Object and turn it back into an xml.
-
0
votes1
answer710
viewsCapture information and use when you need Java
I am thinking of implementing a function that captures the logged in user, I still can not imagine how I can implement such a function, I would like to know what is usual and propitious for me to…
-
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
votes2
answers1857
viewsFor in a Java Object Arraylist
I am studying Java and I have a problem in a code I wrote. I need to read the name and age of 3 people and say the name of the youngest and the name of the oldest. I know the best way for a large…
-
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
answer583
viewsHow to drag some objects and forms in VBA/Excel and prevent the drag of others?
I’m having difficulties when trying to control "drag forms" and "drag objects" in VBA/Excel. For example: I have the main form that I don’t want to be moved, a second form is called from the main…
-
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
answers10008
viewsAdd a value to a JSON object
How could I add a value chain to an object JSON? For example: var a = 12; var b = 3; var obj = { c: 11, d:22 } console.log(obj); How could I apply to and b, within my variable obj to become part of…
-
0
votes1
answer61
views -
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
votes2
answers215
viewsHow to pass the Syntax or Semantics written in the text field, to a Textarea
Let’s go to such doubt, this is more a doubt than a logical reasoning. I have some input on the HTML page, and the same transfers its value(s) to textarea, by clicking a button. Great, so far so…
-
0
votes0
answers69
viewsGet image ID/object Inserted in a Tcxrichedit
Is there any way to get the ID of an image or object inserted in a Richedit? I tried to: IDRichEdit[I]:=RichEdit.Lines.Objects[I].GetHashCode; But gives Accessviolation. Update: The image/object has…
-
0
votes1
answer29
viewsReading variables from an object that was created in another
I’m creating an RPG and I found a problem: I can’t create monsters with levels. My code is like this: var xp = 0; function MonsterCriado(entidade){ Lvl = Math.floor(Math.random() * (11 - 1) + 1);…
-
0
votes2
answers236
viewsWhat would be the most efficient way to replicate this code? (Javascript)
Doubt With this code, I can only create and manipulate a "employee", I wanted to be able to add more employees by clicking a button and manipulate their data. HTML <!DOCTYPE html> <html>…
-
0
votes2
answers55
viewsHow to adapt this function to work without needing the element ID?
I have a function and want to adapt it to work without needing the element ID (document.getElementById("slides");). I saw that there is the possibility to do this using the operator NEW but I had…
-
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
votes1
answer56
viewsArray that is turning into object
When using the json Decode function on a json, I’m having a problem. When the numbering is perfectly in order(0,1,2,3...) it is classified as arra: [2016-08-01] => Array ( [0] => 07:00:00 [1]…
-
0
votes1
answer93
viewsDisplay value of an object item using Javascript
I’m a beginner in Javascript, I don’t know how to display the value qtdeEstoque of listaTamanhos. Can someone help me? alert("Tamanho: " + lista.Value + " / Estoque: " + data[i].qtdeEstoque);…
-
0
votes2
answers1471
viewsTransform object array into only one array
I have a array multiples objects: array(3) { [0]=> object(stdClass)#5750 (2) { ["value"]=> string(16) "[email protected]" ["key"]=> string(18) "email_client" } [1]=> object(stdClass)#5254…
-
0
votes1
answer43
viewsBugando Activity + Memory Error
Good afternoon programmers, I am developing an application and in a certain part of it I populate textviews with some data coming from a webservice. When ordering data from the webservice in a…
-
0
votes1
answer58
viewsCount True values in an Object
I got this feedback from an API: object(stdClass)[2] public 'data' => object(stdClass)[44] public 'id' => float 3.5795374673835E+14 public 'completed' => boolean false public 'name' =>…