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...
I'm bringing backend notifications and I need to dynamically add the path to them, how do I add a <li> to each response element?
JavaScript
$(document).ready(function () {
$.ajax({
url: "/tasks/not-assign",
dataType:...
I would like to ask for your help again in this exercise. This time using the abstract class.
Create an abstract class FuncionarioAbstract with the String name attribute and the abstract method: public double getSalario();...
How can I set the equality comparison behavior between two objects whose class is defined by me that are stored in an object of type ArrayList?
ColorName
public class NomeCor {
private String nome;
public String obterNome() { return no...
I currently have the following functional scenario:
A list of the Studios class with id and name: List<Studios> studios;
I count repeated names in List as follows:
Map<String, Integer> counts = new HashMap<...
I am creating a list from a array using the Arrays.asList method.
Now I want to remove the first element, but Java accuses:
Exception in thread "main" java.lang.UnsupportedOperationException
List<Integer> lista =...
In my college work I should make a list of the type of a class I have created and should sort it in two different ways, one in alphabetical order and one in average. Also other information is that alphabetic ordering should not be standard, but...
Is it possible to use the property of an object as an index of an array , as described in the example below?
using System;
public class Program
{
public static void Main()
{
var myObjectArray = new MyObject[]{
new...