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
-
3
votes2
answers3493
viewsDifference between primitive type and object in Java
In Java, we have so-called primitive types and so-called objects. What’s the difference between the two?
-
3
votes3
answers608
viewsLists repeating last added item
was studying about the lists in C# and I couldn’t understand what was wrong with my code (probably going to be very basic), all the items are the same as the last item added. I simplified the code…
-
3
votes2
answers269
viewsWhat is the __defineSetter__ and __defineGetter__property for?
Every time I open the Chrome Console, I keep an eye on the properties autocomplete, to see if something new comes up, something I haven’t learned yet. And it struck me to see that objects have the…
-
3
votes1
answer116
viewsHow to transform an array recursively?
I have the following array: let exemplo = [{ alarm: { title: "Pai", id: "1" }, children: [], parent: "", }, { alarm: { title: "Filho", id: "2", }, parent: "Pai", children: [], }, { alarm: { title:…
-
3
votes1
answer49
viewsHow to expose a set of functions that is within an object in the global scope?
I’m building a Javascript API that returns a set of functions accessible through an object. Every time I want to access some of these functions, I need to enunciate the object, for example:…
-
3
votes1
answer56
viewsHow to make an interface method receive any object (Object type) as parameter?
I’m studying polymorphism now, and I’m not getting it. Given the interface: public interface View { public boolean existe(Object obj); } I have this method, which I would like to be implemented from…
-
3
votes3
answers165
viewsreturn values of a javascript object
I have this object in which I need to take the largest portion with the rate 0 (without interest) and its value, and also take the largest number of installment available and its value.. I’ve tried…
-
3
votes1
answer591
viewsHow to delete an item from an object using an internal ID (Vue-2)
I have an object with the following format: [ { "id":1, "name":"exemplo1", "email":"exemplo1" }, { "id":2, "name":"exemplo2", "email":"exemplo2" } ] I need to delete an item from this object using…
-
3
votes1
answer116
viewsProblem to use a "System.out" on an object
I’m trying to give a System.out.println on an object I have (even with the toString() in class) I’m getting: Predio [name=LS, aptos=[[Lmodel.Apartamento;@7ba4f24f, [Lmodel.Apartment;@3b9a45b3,…
-
3
votes1
answer255
viewsHow to read JSON object name containing special character?
My JSON file: "locomotives" and "vacant" I can read without problems, but when I try to read "vacant" it contains the following error:: that is, because of the character " - ", it is being…
-
3
votes1
answer122
viewsNeed to use @classmethod in __new__
I was reading about __new__ in the Python documentation and after search here on the site I saw some examples of implementation and noticed that the signature of the method is: def __new__(cls,…
python python-3.x characteristic-language objects metaclassasked 5 years, 1 month ago fernandosavio 9,013 -
3
votes2
answers95
viewsHow do I set contacts for a Phone object?
In class Pessoa declared a array of the kind Telefone which stores 3 phone contacts in the set referred to below it for each contact assigns a type and a number. I have a problem where I want to…
-
3
votes1
answer85
viewsObject access bracket notation does not accept String object
I am trying to call a function which is a property of an object, passing a parameter to it. For this I use bracket notation plus this: (parâmetro). Thus: afraid[day](num.toString()) But returns…
-
3
votes1
answer66
viewscompare javascript objects
in this script, which compares objects in javascript, even if I pass equal values (to my understanding, but which all indicates is wrong), the return remains false. someone could help me better…
-
3
votes2
answers83
viewsObjects eligible for the AG
I have the following certification issue on the Garbage Collector: 1: public class Rabbit { 2: public static void main(String[] args) { 3: Rabbit one = new Rabbit(); 4: Rabbit two = new Rabbit(); 5:…
java objects instantiate-object garbage-collector jvmasked 3 years, 11 months ago Deivson Bezerra 149 -
3
votes2
answers55
viewsHow to save a dictionary to two independent objects in Python?
Consider the following dictionaries: dic1 = {'k1':'Ford','k2':'GM','k3':'Dodge'} dic2 = {'k4':'Audi','k5':'Mercedes','k6':'VW'} dic3 = {'k7':'Fiat','k8':'Mazda'} The goal is to get two new…
-
3
votes1
answer60
viewsHow can a value be invoked (as a function) at the same time as it contains properties (as an object) in Javascript?
I was left with a question concerning the structure of the Express. How Express can be invoked, as in express(), but can also have in its structure access to the Router property, for example? I…
javascript node.js function characteristic-language objectsasked 3 years, 8 months ago Otavio Fagundes 978 -
3
votes2
answers86
viewsWhy does Node.js accept value assignment with the "Undefined" identifier?
I was conducting a quiz on Node.js until I came across the following question: Which message will appear in the terminal for the following code executed by Node.js: Code (note that it runs outside…
javascript node.js characteristic-language objects undefinedasked 3 years, 6 months ago Cmte Cardeal 5,299 -
3
votes1
answer74
viewsAre "Empty" values within an array not eternal?
In this code snippet: let arr = []; arr[3] = null; The following excerpt arr[3] = null; makes the array size according to the value within the array annotation []. The forEach will be used to work…
-
3
votes1
answer89
viewsIs it possible to apply or simulate immutability to an "object" of the Map type in Javascript?
For objects, we can leave it unchanged, so trying to re-assign a new value to a property, adding new properties, or removing properties is not possible. Of course, in case the object suffered…
-
2
votes2
answers343
viewsUsing Flash Professional, how to import classes from an Actionscript file?
In my project I have the Listloader class, responsible for interpreting a list and uploading files described in it. My goal is to save, this and other classes, in a file extension ". as" and be able…
-
2
votes1
answer54
viewsDefining the constructor of an Object
Hello, I’m doing exercises on constructors in Java but I’m having a question. I have two classes Main java. public class Main { public static void main(String[] args) { Duck[] d = new Duck[5]; d[0]…
-
2
votes1
answer759
viewsHow to make livebindings with objects and pick up the objects contained?
I have a problem that I cannot solve in any way. With the Delphi XE8, have already done livebindings to connect screen components TEdit with non-visual objects, but I cannot connect screen…
-
2
votes1
answer24
viewsContraindications in Iife’s
Is there any contraindication using IIFE’s within the context of an object? For example, in the properties begin and created i do the auto run function to set the properties at the time of variable…
-
2
votes1
answer121
viewsGenerating new objects using existing objects
I’m having a hard time doing this. Supposing I have two objects of the kind Person, which has the attributes name and employment. P1 (name=John, job=Taxi driver) P2 (name=Maria, job=Programmer) Then…
-
2
votes1
answer2561
viewsHow to make an array of objects?
How to make a array of objects? I am trying but am not succeeding, returns me an error: line 26 [Error] no match for 'Operator[]' (operand types are 'Time' and 'int') Code: #include <iostream>…
-
2
votes1
answer70
viewsHow to convert XML to Swift objects?
How can I convert XML request replies to objects in Swift format, just like Objectmapper does with JSON for objects?
-
2
votes3
answers10597
viewsAdd element at the beginning of a key object/value
I have the following object: var exemploLista = { "Igor": "exemplo1.jpg", "Joao": "exemplo2.jpg" }; And I’m using this code to add an item to the object: exemploLista["Lucas"] = "exemplo3.jpg"; But…
-
2
votes1
answer94
viewsObject problems using java sockets
I’m trying to pass the person object that was instantiated on the server to the client. But I’m not getting it. Below are the classes I used: Server public class ServidorTCPBasico { public static…
-
2
votes1
answer1771
viewsObject with list of objects within Javascript
I am using angular to make a form that contains multiple checkboxs (using angular-material), this form sends the values to the controler, which are received as follows: I need to take this data (all…
-
2
votes4
answers318
viewsHow to return an object from a dynamic reference in Javascript?
I need to create a Javascript code that returns an object already created with a dynamic reference by its name/id. Basically this: // Define class function Test(num) { this.msg = "Message"; this.num…
-
2
votes1
answer123
viewsCreate a list of ruby on Rails features
I’ve been trying for a few days but I haven’t been able to solve my problem. I need to create a list of features for an item and then list them all. I wish you could help me or give me some tutorial…
-
2
votes4
answers7208
viewsHow to group an object array in javascript (Angular)
How to read an array of objects and returns only objects that contain the same value in several attributes? I made this object array as an example. var arrayDeObjetos = [ {"dia":1 ,…
-
2
votes2
answers310
viewsJavascript prototype: possible to change value of reference object?
EDIT: It’s usually at the end, but the question was poorly worded and I decided to switch to this example that is much better. Follow the example of a function that does nothing as an array method:…
-
2
votes1
answer1325
viewsPassing objects by c++ reference
Talk guys, I’m trying to learn a little C++ and I have a question regarding the passage of objects to a class and manipulation of it within this one. I can do this in C#, but I’m trying in c++…
-
2
votes1
answer121
viewsSort object descending in Java
I need to sort descending the following object and after that I must delete everything that comes after "_" and even him, to see which word is formed: Follow what I’ve done: var str = 'string muito…
-
2
votes1
answer194
viewsStore all types of variables in an array/array?
How can I store values and variables of all types within a vector? Ex: vetor1.Add("valor em string"); vetor1.Add(100); vetor1.Add(100.10); vetor1.Add(-100); I have no idea how I can do this.…
-
2
votes1
answer497
viewsDoubt about JS objects with array
I’m wondering how to make an object that has an array inside, I don’t even know if that’s possible, but it follows more or less what I want to do: var produtos =[ { nome: "Sei lá", cor: azul,…
-
2
votes1
answer181
views -
2
votes1
answer184
viewsPOO in Java - World Cup Modeling
I am entering the universe of Object Orientation and, moved by curiosity, I decided to try to simulate the organization of a World Cup through these concepts. Well, I’m having some difficulties with…
-
2
votes1
answer596
viewsBrowse all properties of a Vuejs object
I am using Vuejs in a project and need to go through all the properties of the object associated with v-model. I know that if it was an array I could use u for, foreach, map and many other means of…
-
2
votes1
answer135
viewsSubistituir dynamic table row
In the catch line function I pick up the clicked line and send the data to the form and store OBJ from the line and get index tbm var index = $(obj).closest('tr').find('td').eq('0').text(); Here…
-
2
votes3
answers91
viewsSomeone can explain to me the following situation:
pessoa = { nome: 'leandro', idade: '2' } for(x=0;x<pessoa.idade;x++){ console.log('Ola mundo'); // ele repete 2 vezes "Ola mundo" na tela } The question I have is that I thought that Javascript…
-
2
votes1
answer189
viewsRuntime object example in C#
Reading an article appeared the following term Runtime Object or "runtime object". What would that object be? Would it be an instance of a class? Someone could pass some example? The part of the…
-
2
votes2
answers359
viewsKeyword "new" in C#
I went to see about the keyword new in C#, but I could not find someone who explains well what I want to know. They say that the new creates a new instance, but I don’t understand exactly what they…
-
2
votes2
answers573
viewsHow to access an object by a variable?
I have two selects sent to the event change the value of data-id and attribute to variable tipo. I have two objects each with values in the keys 1: and 2:. Using tipoUm[1] me returns the value 1.10…
-
2
votes2
answers451
views -
2
votes2
answers1639
viewsHow to Instantiate an Object in C#
How do I instantiate an Object in another class? I’m trying this way: GameObject Cozinha = new GameObject("CenaCozinha"); CenaCozinha coz = Cozinha.AddComponent<CenaCozinha>(); But I believe…
-
2
votes2
answers38
viewsHow to create Object constant in javascript
I want to create Object that cannot be altered, redefined or removed. The aim is to make it possible for objects not to be altered by accident or intentionally.…
-
2
votes2
answers301
viewsWhen should I use a string object and a literal string?
Reading an article I find the following excerpt: You can call any of the methods of the string object in a literal string - Javascript automatically converts the literal string for a temporary…