Questions tagged as 'polimorfismo'

3
answers

Interesting question about inheritance and polymorphism

I found this issue of a public tender interesting: Class A public class ClasseA { public int metodoX(){ return 10 } public int metodoX(int n){ return metodoX() + n } } Class B public class ClasseB extends ClasseA{ public...
asked by 12.10.2017 / 16:22
2
answers

Generalization of parameters in Java

I'm implementing a B-tree for a Java database job, so that it saves any object types, whether it's generic, so I'm treating it like it's Object , but in some precise code snippets of methods as compareTo() , which should be implement...
asked by 20.02.2016 / 18:07
1
answer

Generic type in Java

I have 3 classes, Expression , Operation , Scalar public abstract class Expression<R extends Expression> { public abstract R calcular(); } public abstract class Operation<T extends Expression, R extends Express...
asked by 14.05.2014 / 18:21
3
answers

How to make visual form inheritance in Windows Forms?

I have a form base that will be form 'Father', with 3 buttons in it. Add, Delete, and Change. I'm going to use formbase to standardize my registration screens, so each registration screen when I click 'Record' will execut...
asked by 05.11.2015 / 16:28
2
answers

Error PHP POO Polymorphism

When developing a simple PHP POO application, I came across an unexpected error, and I have no idea why. I'm now starting to study object-oriented programming and I only have a small base in C #. The program itself is simple: two classes (...
asked by 19.10.2017 / 06:27
3
answers

Polymorphically manipulating subsclasses

How does subclass manipulation work for the superclass? In this next code,% w / o of a class, prints the values of other classes. zoo.java public class zoo { public static void main(String[] args) { Vaca mimosa = new Vaca(); Gat...
asked by 06.08.2018 / 21:32
2
answers

How to correctly implement the polymorphism?

One of the first things we hear about when we study the object-oriented paradigm is polymorphism, but how can we or should we implement it? Since it is a concept we see various forms of implementation, how can I better understand how to implement...
asked by 01.06.2018 / 05:11
2
answers

Doubt over access modifiers and polymorphism

I have a very early question about polymorphism / access modifiers in Java. I would like to find out why a certain phenomenon occurs in my code. Here is an example of classes: Class Pai : public class Pai { public void metodo1(...
asked by 09.11.2017 / 19:00
1
answer

Get and display data of an attribute of type class (association between classes)

I'm having a small problem getting a value of an attribute of type class . Person Class public class Pessoa { public string Nome {get;set;} public int Idade {get;set;} public virtual void Add() {...
asked by 21.01.2016 / 21:26
0
answers

Error creating a method in a WFA application in inheritance and polymorphism

I created a WFA project that will serve as the basis for the rest, as follows: I created a FormBase that has public control variables such as the operator name, date and time of access to the systems; I created a FormBasePrincipal, which...
asked by 04.08.2015 / 21:00