Questions tagged as 'genericos'

1
answer

Because the syntax to indicate that a parameter of a generic class is comparable is T extends ComparableT?

I've been looking at different posts about the same question but I do not understand why in the syntax <T extends Comparable<T>> you put the word extends and not the word implements , if Comparable is an in...
asked by 31.10.2018 / 00:03
1
answer

Get the full name of a property

I am working on C #, using Linq Dynamic to do some sorting, so I was generated the need to obtain the names of the properties as string . When the properties are simple, they do not generate any conflict, since I can use nameof()...
asked by 22.11.2018 / 14:07
1
answer

Get the name of a generic class in a java interface

I have the following case: public interface CustomRepository<T> { ... } public class CustomRepositoryImpl<T> implements CustomRepository<T>{ //Como puedo obtener el nombre de la Clase T } //Por ejemplo si uso la clase Usuar...
asked by 29.03.2018 / 23:21
1
answer

Generic class in Java

I have the next class, but now we want it to be generic. The first thing we did was to call the @param <E> and extend the comparable class, in order to use compareTo but we did not know how to change the code: /* * To...
asked by 14.09.2018 / 20:53
1
answer

Create a list of objects with Generics

Good evening community, today I'm doing a simple exercise to consult a database and return a list of objects with the result of the query, however not to repeat code consult the database by every type of object that requires consulting estory us...
asked by 03.02.2018 / 03:00
2
answers

as exteneder a generic class in java

I want to have a class in which I can indicate which class it extends. Something like public class ComunAux extends T { private MyObject obj [...] } The opposite is not valid for me: that a class extends ComunAux and thus have that...
asked by 05.10.2018 / 12:04