I understand that interfaces are contracts and any changes (even additions) break any dependent code. However, I could have sworn I read something a while back that one of the recent .NET versions (3, 3.5??) added a new attribute that could be applied to new interface members. This attribute allowed versioning and/or making members opt...
I see many methods that specify an interface as return value. Is my thought true that it means: my method can return every class type that inherits from that interface? if not please give me a good answer.
...
I don't see anything that I am doing wrong, but NetBeans gives me the following error:
incomparable types
required: boolean
found: java.lang.Object
public int compareTo(Object obj) {
if( obj instaceof Employee){
Employee employee = (Employee) obj;
if(this.weekly_earnings > employee.weekly_earnings)
return...
I am looking to generate ruby modules from existing C libraries.
In the past, I have used Swig, and found that it was a painful task. I just want to check if there's something better for Ruby out there, and any gotchas.
Just need to evaluate choices, so even a simple url pointing me to the site will do!
...
Can anyone confirm that [[UIDevice currentDevice] setOrientation:UIDeviceOrientationPortrait]; will get your app rejected by Apple.
Is there a good replacement available?
...
In my system I have two different projects, one defining its interfaces and another defining its domain objects. So far I managed to have the interface definitions independent of the domain objects but I am feeling now the need to include certain domain objects either as parameters of the methods defined in the interfaces or as return va...
I have the following code:
import com.apple.dnssd.*;
public interface IServiceAnnouncer {
public void registerService();
public void unregisterService();
public boolean isRegistered();
}
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
Th...
Hi,
I would like to create a main menu and a hud within the application that stores and displays user information. Buttons like sound and main menu options should exist..
Now i cant seem to find any examples of how to create this user interface / hud.
Any suggestions would be very helpful.
Thanks,
CS4
AS3
...
I'm trying to write something similar to this (sorry if the sample is not 100% correct, im just writing off the top of me head):
interface Handler
{
void doSomething ( );
}
otherclass
{
void othermethod ( Handler handler )
{
// Handler do something
}
}
So in ObjectiveC I made the following:
@protocol Handler
-...
Hi,
Can a Objective c interface have more than one implementation? Example I could have a interface but 2 implementations one where i use an arrays or another where I use a stack..etc to implement it.
If so how do you call it / syntax?
Thanks
...
given this class definition:
public class Frame
{
IFrameStream CapturedFrom;
}
I want implement Clone() method in this class, but problem is:
How to create the IFrameStream field in the destination instance? - I just don't know its implementation, how to create the instance?
...
Hi.
I have two basic interface-related concepts that I need to have a better
understanding of.
1) How do I use interfaces if I only want to use some of the interface
methods in a given class? For example, my FriendlyCat class inherits from
Cat and implements ICatSounds. ICatSounds exposes MakeSoftPurr() and
MakeLoudPurr() and MakeP...
is that possible to create a inner class within an interface?
If yes, why do we create like that?
Anyways we are not going to create any interface objects?
Do they help in any Development process?
...
Put them all in one separate folder structure or along with classes which implements them ?
...
Hi,
I've made an interface called ApprovalEvent in a separate file with the namespace myproject... I've also made a class called PurchaseOrder... it's also in the same namespace, just in a separate file. Whenever I try to make PurchaseOrder implement ApprovalEvent it always says that ApprovalEvent is undefined...
How can I make the cla...
I realize that the method run() must be declared because its declared in the Runnable interface. But my question comes when this class runs how is the Thread object allowed if there is no import call to a particular package? how does runnable know anything about Thread or its methods? does the Runnable interface extend the Thread clas...
I have a interface member like this.
AppInterface.cs
ObjLocation[] ArrayLocations { get; }
App.cs
public ObjLocation[] ArrayLocations
{
get
{
return **something**;
}
}
I dont know how to complete it, Or there is another way to implement the array members.
Then It...
Hi folks,
both the interfaces seem to compare objects for equality, so what's the major differences between them?
TIA
...
I am creating the domain model in my system. When designing my model objects, should I make interfaces for each entity object? People have told me that our web tier should not care about the implementation of an entity and we should be able to swap out implementations, but I'm not sure that would ever happen.
For example, if we have a...
Consider I have the following interface:
public interface A { public void b(); }
However I want each of the classes that implement it to have a different return type for the method b().
Examples:
public class C {
public C b() {}
}
public class D {
public D b() {}
}
How would I define my interface so that this was possibl...