Questions tagged as 'objetos'

1
answer

Calling an object while creating another object

I have a Person class and a Date class, the Person class creates a person the date class creates a date to use as the date of birth in the Person class, how is it that when creating a Person I create a date without having to use the code complet...
asked by 26.07.2016 / 23:43
3
answers

Are objects similar to arrays?

Objects are arrays in JavaScript? I have difficulty understanding how this is possible: var obj = { title: 'some value' } console.log(obj['title']); // some value In my conception the use of brackets is only possible in lists to pass a...
asked by 08.04.2016 / 19:20
1
answer

When the destructor of an object is called in C ++?

Let's suppose I have a function: std::string empty_string() { std::string x{ "" }; return x; } As much as it seems normal, it gets kind of confusing when we think: When the destructor of object x is called? Please no...
asked by 11.08.2018 / 04:15
2
answers

Get information from the sender object

How does the search for information through the sender object work, and in what situations can I use it, with what types of events? This is to avoid redundancy of events. Where can I explore these possibilities? For example : several buttons fro...
asked by 31.05.2014 / 04:25
1
answer

Access values within an array from the index

I have a x variable with the following content inside: x = [ { id: '1', name: 'name, } ] And I thought that to access id was x.id , but it is not so. How to access?     
asked by 22.05.2016 / 20:24
3
answers

Traversing objects with pure JavaScript

I need to list objects and I have used the following function that is in jQuery. Is there an alternative to this in JavaScript only? $.each(object, function(index, value) { console.log(value); });     
asked by 04.10.2015 / 16:24
5
answers

How to use the reduce (reduce) operation on objects?

In Javascript, when I need to do a reduction operation, I use the Array.reduce method. So: var valores = [1, 2, 3, 4, 5, 1000]; var resultado = valores.reduce(function (soma, atual) { return soma + atual; }) console.l...
asked by 13.11.2017 / 12:44
1
answer

Java PriorityQueue Comparator

I'm trying to understand why the native java mode is not comparing, I do not know where I'm going wrong. MAIN // EXERCICIO PARA COMPARAR DOIS OBJETOS, USANDO CLASSE NATIVA DE COMPARAÇÃO DO JAVA public static void main(String[] args) {...
asked by 17.01.2018 / 12:11
2
answers

What is syncblock?

I received a response that spoke about a syncblock . Why is it necessary? From what I understand, what I researched is competition control. But why does every object need it if not everyone will have competition?     
asked by 28.04.2017 / 16:34
2
answers

Restrict method override of an object in javascript

I'm trying to create an object where its methods can not be changed. That is, its value, even if changed, should continue as initially defined. Example: var object = (function(object){ object.method = function (text) { retu...
asked by 09.02.2015 / 16:11