Help coderanch get a
new server
by contributing to the fundraiser

sarada konda

Greenhorn
+ Follow
since Dec 10, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sarada konda

String str= new String("javaRanch");
int [] strArr = new int[str.length()];
for(int i=0;i<str.length();i++)
strArr[i]=(int)str.charAt(i);


This may help u out
19 years ago
can any one help me
is there any specific reason behind naming java as java2.0 after jdk1.2.x ??
similarly java 5.0 ---- jdk1.5.x



thanks in advance
19 years ago
class A
{
public void method1()
{
System.out.println("A"):
}
}

class B extends A
{
public void method1()
{
System.out.println("B");
}
}
class C extends B
{
public void method1()
{
super.method1();// but here i want call class A's method1
}
}

thanks in advance
19 years ago
Explaning ur doubt with an example
suppose that a class can extends more than one class

class A
{
public void method1()
{
System.out.println("class A method");
}
}

class B
{
public void method1()
{
System.out.println("class B method");
}
}

class C extends A, B
{
public static void main(String s[])
{
C c = new C();
c.method1(); //here is the ambiguity
}
}

the ambiguity raises because it doesn't know which method to be called either of ClassA or of ClassB
19 years ago
Below is the program for creating and printing linkedlist without using java collection framework



[JAM -- edited to have [CODE] and [/CODE] tags]
[ December 14, 2004: Message edited by: Joel McNary ]
19 years ago
I know the interface has one major adv over abstract class i.e
interface -> a class can implement more than one interface
abstract class -> a class can extend only one abstract class
apart from this is there any major advantage of using interface instead of abstract class.
19 years ago
Abstract class statisfies all the needs of interface.i.e

interface Test1
{
void method1();
void method2();
......
}
can be replaced with the following abstract calss

abstract class Test{
abstract public void method1();
abstract public void method2();
....
}

so then can any tell me what's the use of interface. thanks in advance
19 years ago