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
Answer Posted / 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 |
Post New Answer View All Answers
What is the scope or life time of instance variables?
Which package has light weight components in java programming?
What is ctrl m character?
how can i use a nonsynchronized hashtable?
What are recursive functions?
How many types of equations are there?
What is the intersection and union methods?
What is the base class in java from which all classes are derived?
Why do we use variables?
Can a class be private or protected in java?
What is anti pattern in cyber security?
Write a program to print fibonacci series up to count 10.
What is stream api in java8?
What is the difference between jdk, jre, and jvm?
What are java packages?