Hi Every One I Have Small Doubt Please answer
This????????????????????????????

I Want to use AbstractList class
methods(java.util.AbstractList)

My Program is

import java.util.*;
class DemoOne extends AbstractList
{
public static void main(String[] args)
{
AbstractList a=new DemoOne();//This One is Correct??
DemoOne a1=new DemoOne();//This One is Correct?? Both Are
Not Working
System.out.println("Hello World!"+a);
System.out.println("Hello World!"+a1);
}
}

Error IS:
DemoOne.java:2: DemoOne is not abstract and does not
override abstract method get(int) in java.util.AbstractList
class DemoOne extends AbstractList


AnyOne can Please Provide The
Solution????????????????????????? Plzzzzzzz

Answers were Sorted based on User's Feedback



Hi Every One I Have Small Doubt Please answer This???????????????????????????? I Want to use Ab..

Answer / tirumurugan

please Try Following code

import java.util.*;

class DemoOne extends AbstractList {
public static void main(String[] args)
{ AbstractList a=new DemoOne();
//This One is Correct??
DemoOne a1=new DemoOne();
System.out.println("Hello World!"+a);
System.out.println("Hello World!"+a1);
}

@Override
public Object get(int index) {
// TODO Auto-generated method stub
return null;
}

@Override
public int size() {
// TODO Auto-generated method stub
return 0;
}
}

It will work without error.

Is This Answer Correct ?    3 Yes 0 No

Hi Every One I Have Small Doubt Please answer This???????????????????????????? I Want to use Ab..

Answer / prashanth.vuthuru

AnyOne can Please Provide The
Solution????????????????????????? Plzzzzzzz

Is This Answer Correct ?    0 Yes 0 No

Hi Every One I Have Small Doubt Please answer This???????????????????????????? I Want to use Ab..

Answer / raghav

Bcoz ur class ( DemoOne ) is concrete class so u r forced to provide body to that methods that r unimplemented in java.util.AbstractList

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

long d =10;int i =0;i=d; /// is this possible? If d is very long number (10 digits or some thing) then?

3 Answers  


What carriage return means?

0 Answers  


Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

0 Answers  


How do I get the | symbol on my keyboard?

0 Answers  


What is java objectoutputstream?

0 Answers  






Suppose there is a System A which gives some output. This output is used as input by system B. The rate at which System A produces is faster than the rate at which system B consumes it. How can you improve this?

1 Answers   RBS,


How variables are stored in memory?

0 Answers  


What is the abstraction?

0 Answers  


Is constructor inherited?

0 Answers  


What are the advantages of java over C++?

0 Answers  


What is the arguement of main method?

1 Answers  


What is the purpose of the runtime class in java programming?

0 Answers  


Categories