Questions tagged as 'polimorfismo'

1
answer

Contest Doubt on Inheritance and Polymorphism in Object Orientation

I took the test of the IFNMG competition for the position of computer teacher. The bank that prepared the test was the CEFET Foundation. One of the issues was as follows:    About the following statements related to programming concepts   ori...
asked by 18.12.2018 / 22:18
2
answers

Why does not polymorphism work with Generics?

When trying to compile the following code I got an error. import java.util.*; class Animal { } class Cachorro extends Animal { } public class TestePoli { public static void main(String[] args) { List<Animal> cachorros = new A...
asked by 10.03.2014 / 00:06
1
answer

What are the differences between overrideing and overloading in Java?

What are the main differences between overrideing and overloading in Java? What is the relationship between these terms with Polymorphism?     
asked by 14.03.2017 / 12:58
2
answers

How and when should we use Interface to document systems in PHP?

I've always wanted to know exactly, if it's a good practice, to make a system always using Interfaces, or is it not necessary? Interface People { public function getName(); public function setName($string); public function getAge(); pu...
asked by 26.11.2015 / 12:45
3
answers

Doubt on Inheritance

I have the following case: Avo.java: public class Avo { public String quemEuSou(){ return this.getClass().getName(); } } Mae.java: public class Mae extends Avo{ @Override public String quemEuSou() {...
asked by 17.02.2016 / 19:21
1
answer

What are the differences between the concepts of Polymorphism and Overwritten in OOP?

I was a bit confused when researching about polymorphism. The concept of polymorphism resembles the concept of overwriting. What are the differences between polymorphism and overwriting in OOP?     
asked by 27.09.2015 / 19:58
2
answers

Is this polymorphism?

Is this polymorphism? If so, why? I think it's because there is no method call. Please explain if I am correct or correct me. Thank you :) OutputStream saida = new FileOutputStream("alunos.pdf");     
asked by 26.07.2016 / 05:54
2
answers

What is the relationship between encapsulation and polymorphism?

A few days ago, I was talking to a friend about Java, and asked what part of the subject they were studying. So he replied that they were starting their studies on inheritance. As they were long overdue, I asked how they suddenly jumped to in...
asked by 22.06.2017 / 19:26
1
answer

Polymorphism or inheritance?

I'm learning about polymorphism and I'm in the doubt whether what I'm doing is actually polymorphism or just inheritance? If it is polymorphism what do you have in my code that I can clearly identify that is polymorphism? If it is not, wha...
asked by 22.09.2016 / 22:17
1
answer

What is the difference between virtual and abstract methods?

In which cases should I prefer to use one type instead of the other?     
asked by 13.10.2016 / 17:34