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
146 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,800 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 in Java by Rahul
• 9,680 points
112 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 in Java by Rahul
• 3,380 points
63 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 in Java by Rahul
• 3,380 points
75 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 in Java by Kichu
• 19,040 points
60 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
9,069 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
7,490 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
1,728 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,890 points
5,255 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,800 points
1,386 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,800 points
2,295 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