Roopa Prabhu

Greenhorn
+ Follow
since Feb 05, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Roopa Prabhu

Hi,

When the socket connection between 2 process running on the same machine gets cut abruptly and when I try to run it in debug mode and check the exception, this is what it shows:
Stack frame unavailable Cannot evaluate sun.nio.ch.ServerSocketChannelImpl.toString()
hi... take a look at this code.

interface I5 {
final int i = 5;
public void help();
}
interface I6 {
public int help();
}
class D {
D () {
System.out.println("This is D");
}
public void printThis () {
System.out.println("superclass version");
}
}
public class C extends D implements I5, I6{
private int a;
public int help() {
System.out.println("from I6");
return 1;
}
public void help() {
System.out.println("sdkfj");
}
C () {
System.out.println("Tjis is D");
}

public void printThis() {
System.out.println("subclass version");
String x = "192.1.2.3";
System.out.println("hello");
}

public static void main(String args[]) {
new C().help();
}
}

Here i'm getting a compile time error:
Duplicate method help in type C
how do i overcome this problem. if i have 2 methods with same name in 2 interfaces. interfaces not serving the purpose of multiple inheritance.

Please reply soon. it's urgent.

Thanks,
Roopa.
17 years ago
Why will it get deleted? i didn't get any notification after giving my display name as Roopa...
Let me know if there is any technical problem?
17 years ago
Thanks Jesper...
My doubt is: why is it not asking for an implementation of the subtract method for the interface I1?
17 years ago
Please take a look at this code.

interface I1 {
public void add();
public void subtract();
}

abstract class AbstractFourOne {
abstract public void add();

public void subtract() {
System.out.println("Subtract from abstract class...");
}

static public void printIt() {
System.out.println("Printed");
}
}

public class Four extends AbstractFourOne implements I1{

public void add() {
System.out.println("Add");
}
/*
public void subtract() {
System.out.println("Subtract");
}
*/
public static void main(String[] args) {
new Four().add();
new Four().subtract();
AbstractFourOne.printIt();
}
}

This code neither gives a compile time error nor a run time exception. Instead it shows the output:
Add
Subtract from abstract class...
Printed

Why doesn't it as for implementation code for the subtract method of the I1 interface although there is no relationship between I1 and AbstractFourOne.
17 years ago
Can anyone please tell me which is the jar file associated with Collections?
17 years ago
Please take a look at this code.

interface I1 {
public void add();
public void subtract();
}

abstract class AbstractFourOne {
abstract public void add();

public void subtract() {
System.out.println("Subtract from abstract class...");
}

static public void printIt() {
System.out.println("Printed");
}
}

public class Four extends AbstractFourOne implements I1{

public void add() {
System.out.println("Add");
}
/*
public void subtract() {
System.out.println("Subtract");
}
*/
public static void main(String[] args) {
new Four().add();
new Four().subtract();
AbstractFourOne.printIt();
}
}

This code neither gives a compile time error nor a run time exception. Instead it shows the output:
Add
Subtract from abstract class...
Printed

Why doesn't it as for implementation code for the subtract method of the I1 interface although there is no relationship between I1 and AbstractFourOne.
17 years ago
Please take a look at this code.

interface I1 {
public void add();
public void subtract();
}

abstract class AbstractFourOne {
abstract public void add();

public void subtract() {
System.out.println("Subtract from abstract class...");
}

static public void printIt() {
System.out.println("Printed");
}
}

public class Four extends AbstractFourOne implements I1{

public void add() {
System.out.println("Add");
}
/*
public void subtract() {
System.out.println("Subtract");
}
*/
public static void main(String[] args) {
new Four().add();
new Four().subtract();
AbstractFourOne.printIt();
}
}

This code neither gives a compile time error nor a run time exception. Instead it shows the output:
Add
Subtract from abstract class...
Printed

Why doesn't it as for implementation code for the subtract method of the I1 interface although there is no relationship between I1 and AbstractFourOne.
17 years ago