What does Animal a Animal data 0 do

0 votes
Hi,
I saw some code where class was initiated or called like below in myMethod, what does the following code do?  It doesn’t have new to initiate the class Animal, so how does this work?  Does class Animal have to have constructor with Object as a parameter?

Public void myMethod(Object[] data)
{
    Animal a = (Animal) data[0];
}

Thanks in advance!
Dec 2, 2020 in Java by zaraaq
• 270 points
317 views

1 answer to this question.

+1 vote

Hello @zaraaq ,

You can refer this for your releted queries:https://javascript.info/class-inheritance

answered Dec 2, 2020 by Niroj
• 82,880 points

Related Questions In Java

0 votes
1 answer

What does "javascript:void(0)" mean?

The href of the link helps with ...READ MORE

answered Feb 8, 2022 in Java by Rahul
• 9,670 points
689 views
0 votes
0 answers

What does "javascript:void(0)" mean?

<a href="javascript:void(0)" id="loginlink">login</a> I've seen such hrefs many ...READ MORE

Apr 14, 2022 in Java by Rahul
• 3,380 points
215 views
0 votes
0 answers

What is a NullPointerException, and how do I fix it?

What are Null Pointer Exceptions (java.lang.NullPointerException) and ...READ MORE

Apr 26, 2022 in Java by Rahul
• 3,380 points
354 views
0 votes
0 answers

What is a IOException, and how do I fix it?

What is causing java.io.IOException? What does it ...READ MORE

May 19, 2022 in Java by Kichu
• 19,050 points
211 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,754 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,624 views
0 votes
2 answers

What is the role of TestNG & JUnit frameworks in Selenium?

TestNG and JUnit are test frameworks . it ...READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
2,522 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
6,699 views
0 votes
1 answer

How do I make a list with checkboxes in Java Swing?

Hii @kartik, Create a custom ListCellRenderer and asign it to ...READ MORE

answered May 8, 2020 in Java by Niroj
• 82,880 points
2,152 views
0 votes
1 answer

What is the equivalent to a JavaScript setInterval/setTimeout in Android/Java?

Hii @kartik, As always with Android there's lots ...READ MORE

answered May 26, 2020 in Java by Niroj
• 82,880 points
3,199 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP