Questions tagged as 'instanciar-objeto'

2
answers

Use of the "Instance of"

public class AlunoLicenciatura extends Aluno{ private String curso; private ArrayList<Disciplina> l_dis; public AlunoLicenciatura(String curso,Aluno a){ super(a.getNumero(),a.getNome());//recebe o numero e o nome de al...
asked by 26.11.2017 / 22:47
1
answer

How to find an object by name only?

I have 6 PictureBox , so when saving the photo in the database, saved together in which PictureBox it was. Then, when loading photos into a view, I need each photo to be displayed in its PictureBox , I query the database by...
asked by 19.05.2017 / 20:46
2
answers

What is the difference between instantiating in the same variable or in 3 different variables?

Follow part one: class Pessoa{ String firstName String lastName int age def address static main(args) { def p = new Pessoa() p.setFirstName("Lars") p.lastName = "Vogel" p.address = "Homestreet 3"...
asked by 17.12.2015 / 14:43
1
answer

Static method with object as parameter

I am creating a very simple system for registering students. I made a Aluno class as follows: public class Aluno { private String nome; private String matricula; private String curso; private int periodo; private Str...
asked by 24.05.2016 / 17:02
1
answer

Error adding new instances to an array in Javascript [closed]

I have the following problem I have an array that adds the instance of an auxiliary object to the instance of an HTMLElement, but only the last element is being added, I tested it in the Chrome, Chromium, Opera and Mozilla Firefox browser and in...
asked by 13.04.2014 / 23:51
1
answer

Inheritance, polymorphism and access to methods

I have 3 classes and 1 enum : public class Pessoa { private TipoPessoa tipo; public TipoPessoa getTipo() { return tipo; } public void setTipo(TipoPessoa tipo) { this.tipo = tipo;...
asked by 25.03.2018 / 19:57
1
answer

Why object is not 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;...
asked by 15.10.2015 / 17:01
3
answers

How to instantiate a model and get its resources by its name in Ruby on Rails

Since I have the abstract class User , and its subclasses Client Employee and Admin , I would like to render screens according to the chosen subclass. Therefore:      users/_form.html.erb : should contain a selection b...
asked by 12.01.2015 / 14:29
2
answers

Class accessible in every application C # [closed]

I would like a class that is not static to be available to the entire application. At first I thought of making this class static, but for obscure reasons that is not the case, I can not make it static. Then I researched something and found s...
asked by 17.01.2017 / 20:01
2
answers

Is it possible for a Closure (Swift) to capture reference of the instance of the object that executes it?

I'm passing a closure to an object's property, and within the closure I'd need to reference the instance of the object that will execute the closure. Example: typealias validator : ()->Bool class Field : NSObject { var name...
asked by 21.11.2016 / 14:23