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
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 |
Answer / prashanth.vuthuru
AnyOne can Please Provide The
Solution????????????????????????? Plzzzzzzz
| Is This Answer Correct ? | 0 Yes | 0 No |
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 |
I want to run a simple hello world java (HelloWorld.java) program using a batch file. How can i run it and how to construct a batch file.
wat is final...? wat is finally...? wat is finalize....? difference between " final and finally and finalize "...?
In how many ways we can create threads in java?
What Is Query Throttling in java?
What is an abstract class?
Is call by reference possible in java?
What does the three dot emoji mean?
what is session facade ?
Can an anonymous class be declared as implementing an interface and extending a class in java programming?
Difference between overriding and overloading in java?
How many bytes is 255 characters?
Does A Class Inherit The Constructors Of Its Superclass?