Interface and getClass() usage

This is a repost of a thread I had in Java Programming Forum. It was not being answered so I though I would repost it here since their is some concept I must be missing.
Original is here http://forum.java.sun.com/thread.jsp?forum=31&thread=261941
If you answer this you will get the points there as well if you post there(so I can grant them).
public class A implements myInterface{}
public class B {
  public static void main(String [] vars){
    A a = new A();
    B b = new B();
    b.test(a);
  void test(myInterface interf){
    //Class c = interf.getClass(); //this throws NoSuchMethodError or NPE depending on -classic
    Class c = ((Object)interf).getClass(); //this always works
    System.out.println("class is " + c);
public interface myInterface {}Any ideas on this one? This is the actual code used to produce the error. JDK 1.3 and 1.4 too.

In fact it was not clearly explained. It was clearly explained why it should work, and I knew that it should before I even posted it. But it does not.
In the end I have concluded that it is JBuilders fault.
Before you point the finger let me assure you that the JRE is
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
Classic VM (build 1.3.1-b24, native threads, nojit)
I tried from the command line and this works fine. I tried in JBuilder and it does not. I not going to try and figure out why, thats Borland's job, but clearly they have a problem.

Similar Messages

  • Nokia's user interface and software A terrible e...

    (hope this is in the right section, here goes)
    I got my E63 about a month ago. I thought it only fair to list my grievances with the phone so far, because I am really close to selling it and buying something else, and I think Nokia deserves to know the reasons why, and will hopefully improve in the future.
    I will start off with what I love about the phone, because I do in fact, really like it. The slim size, excellent keyboard, great connectivity like 3G and Wi-fi, and the reasonable battery life, make it a great phone, but its in the user interface, and actual usage of the phone, where things really start to fall flat.
    The user interface is very disorganized and difficult.
    Why is everything so hard to find and use? For example, if I want to change the applications that appear on my home screen, I need to navigate the following directory tree:
    Menu > Tools > Settings > General > Personalisation > Mode Settings > Home Screen Applications > Application Shortcuts > Shortcut 1
    and then, when I finally get to the list, the items arent even in any order!
    You must be joking, what a horrible menu! Its insane. As a user, I feel like its a terrible experience.
    But thats not all. Why are there 2 notes applications on my phone? There's notes, and active notes. Why does Nokia OVI store exist twice, once in the main menu, and once under installations? Why do I have Contacts, and OVI contacts on my phone? Why can't my phone have just one app that works well, instead of 2 that differ slightly.
    Why is email setup in the installations menu? Why isn't it under email, where mailboxes get set up? Its just sitting there cluttering up Installations, when its something you only use once or twice.
    Not to mention the fact that the configuration settings are all over the place, i.e. there is an Email Key setting in Menu > Tools > Settings > General. Its all on its own, not near anything. Why isn't it in the same menu where the other shortcut keys get set? Or even in the email app settings?
    I am not naive, I know that the E63 is on the cheaper end of the scale, so I can't expect it to be the fastest phone in the world, but scrolling through my email in HTML mode is so horribly slow, and the view tends to jump from left to right on some emails, I hardly even use the phone to check my email anymore, which is sad because that is the reason I chose the E63.( for the nice keypad and email syncing)
    These are just SOME of the things that I have noticed. So please Nokia, PLEASE PLEASE PLEASE! Spend some of your R&D money on user interface and user experience!
    If there is anything you take away from this letter, let it be this:
    Doing anything on the phone just feels like hard work, it makes me not want to use the phone.
    Your phones should be simple and easy to use, even without the mass of Help files that appear in a lot of the menus.
    I know, some people may say that if I want a better experience, I should be willing to buy a more expensive phone. Well, I can say that if I do spend more money on a phone, the chance is very slim that it will be a Nokia.
    Really, I am not being nasty, just trying to be honest. I know that Nokia is run by human beings like myself, so I tried to be polite, and I dont intend to hurt anyones feelings.
    I am quite willing to answer any questions you may have. Its a bit of a pipe dream, but I would love to see Nokia release an entirely new version of the phone software, with everything re-organized and re-done. The sad truth is that will probably never happen, and I will end up swopping my E63 for something that is easy and pleasant to use.
    So please, let me know if there is anything I can do to change the situation, or help you guys in making this better for everyone.

    "If your not used to symbian you'll learn it quick enough, compared to android it's childsplay."
    On the contrary, Ive been using Nokia phones for the last 8 years, and for the last 2 years Nokia exclusively, and the UI has just got worse.
    The fact that "you'll learn it" is of no comfort. Why should I have to spend hours learning how to use a cellphone? Whenever I want to do something I havent done before, I have to spend time digging through obscure menu options. That is absurd.
    "What phone do you have in mind to replace the E63,  that would help us users alot more then telling us what is wrong with your phone.  Although over all I like my e63."
    I don't have any specific phone in mind, Im just going to ask and look around until I find something with an operating system that is organised in a logical manner, and that allows me to access and read my email quickly and easily.
    I put this here hoping that other users would come forward with UI related things that they were unhappy about,  and then Nokia would take notice. I could easily have just gone out and changed phones, but I chose to do something different.

  • Separate interfaces and classes in separate packages?

    I am writing an application in the package 'models.geometry'. I am beginning to get a growing number of interfaces with corresponding implementation classes. I therefore consider adding another packages an move all the interfaces to this package and keep the implementation in the original package:
    'models.igeometry' // for the interfaces
    'models.geometry' // for the implementation
    But is this interface/class - package separation good practice?

    First of: Usage of the prefix "I" to identify interfaces is rather rare in the Java world (it's not unheard of, but definitely not the norm). And I've never seen "i<package>" to identify a package containing interfaces, so I wouldn't suggest it.
    The question is: What does the code which uses your packages access? Does it only need the interfaces and a factory? In this case, I'd separate the packages into "models.geometry" and "models.geometry.impl".
    If the classes are first-level API, just as the interfaces (think Link/ArrayList, Map/HashMap), then I'd keep them in the same package or separate them on some other property.

  • Engineer's Interface and Subcontractor's Interface

    Does anyone know what "Engineer's Interface" and "Subcontractor's Interface" mean in Primavera P6?
    Regards
    Hawker

    I cannot explain in detail here but bottom line is
    Web is not a live database, its parent is client database were planners are working.
    Web takes the summarize data from Client.
    For example CPI, SPI, Gantt chart, Resource usage.........
    It all comes to quality of planning done at client.
    Web is a fancy tool that has the power to
    Compare projects and portfolios + Plan resources at project level
    Have Calculated UDF that shows traffic lights as required by Executives.
    However, Project Planning using WEB is slow with less options and flexibility for a planner when compared to Client.
    Hope it gives a bit of understanding from where I am coming from.
    Cheers.
    Jawad
    P6 Project Controls Co-ordinator and Administrator
    Novo Rail, Sydney

  • Interface and Abstract class difference

    An interface can be used in such a way that we don't know the class of object assigned to a reference of that interface type until runtime. Can we use the abstract class in a similar way too?
    The difference between an abstract class and interface can be listed as
    1. Interface can not have implementation of any method
    2. The usage of interface and class is one other difference
    3. What other differences we have?

    Yes an abstract class can be used in a similar way. The main issue with an abstract class is that you extend it and you can only extend one class so that can be a huge limitation that an interface does not give you.
    Here's another one that is often overlooked: use both.
    public abstract class SomeBaseClass implements Runnable {
      public abstract void someAbstractMethod();
      public void someMethodWithADefaultImplementation(){
        System.out.println("Hello!");
    }Any class that extends SomeBaseClass (and is not abstract) will need to implement the run() method of the Runnable interface.

  • How to check the memory and CPU usage on NPU

    Hi expert ,
    Could you tell me how to check the memory and cpu usage on NPU?
    I think ASR1000 has this command (show platform hardware qfp active...) , but I coudn't find the same command on ASR9001.
    I checked " show controllers np counters all"  command, but I did not find it.
    Platform: ASR9001
    version: 4.3.2
    NP: Tyhoon
    Thanks,

    Hi Kanako,
    understand your question, but something like that doesnt exist for the trident/typhoon NPU's for the asr9k.
    in fact cpu usage is not really applicable for parallel/serialized hardware forwarders, but mainly the KPI is here
    the PPS it handles.
    The max pps it can handle is dependent on feature set.
    What you could do is measure the rates on the PARSE_FABRIC_RECEIVE count (packets received from fabric, so egress direction), PARSE_ENET_RECEIVE count (packets received from the interface to the fabric, so ingress) and the LOOPBACK count, that is packets that are recirculated for extra processing. The sum of these 3 gives an idea of the PPS rate the NPU is working on.
    Memory consumption is something tricky also, there are many memories attached to the NPU, notably:
    TCAM used for vlan matching, ACL and QOS matching
    Search memory for L2 and L3 (shared on Trident, separated on Typhoon)
    Frame memory for packet bufferin in QOS
    Stats memory, for all kinds of counters of QOS maps, interface stats etc
    their usage is rather dynamic also.
    The few things you want to verify on these are:
    - ACL usage (in terms of Tcam entries)
    - MAC table size (2M max on typhoon)
    - FIB size (4M max on typhoon)
    frame memory is dependent on the buffering, which is a sum of all the packets instant queue length and size of all pmaps attached to interfaces served by the same NPU. there is no good overview as to how much you have available of that, but it has a rather significant size 1G or 2G depending on the TR or SE cards (typhoon specific).
    regards
    xander
    Xander Thuijs CCIE #6775
    Principal Engineer 
    ASR9000, CRS, NCS6000 & IOS-XR

  • [svn] 4081: Remove @private from an interface and class

    Revision: 4081
    Author: [email protected]
    Date: 2008-11-12 06:50:02 -0800 (Wed, 12 Nov 2008)
    Log Message:
    Remove @private from an interface and class
    QE Notes: None
    Doc Notes: None
    Bugs:
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBaseContentH older.as
    flex/sdk/trunk/frameworks/projects/rpc/src/mx/messaging/messages/ISmallMessage.as

    System.arraycopy()
    You're almost certainly better off with a List implementation, though. Whether you use LinkedList or ArrayList should depend on your usage specifics, but from the limited information provided it seems that LinkedList would be a better choice.

  • The difference between IEEE802.1Q Native VLAN sub-interface and Physical interface?

    Hello
    I think the following topologies are supported for Cisco Routers
    And the Physical interface also can be using as Native VLAN interface right? 
    Topology 1.
     R1 Gi0.1 ------ IEEE802.1Q Tunneling  L2SW ------ Gi0 R2
    R1 - configuration
    interface GigabitEthernet0.1
     encapsulation dot1Q 1 native
     ip address 10.0.0.1 255.255.255.0
    Topology 2.
    R1 Gi0 ------ IEEE802.1Q Tunneling L2SW ------ Gi0 R2
    interface GigabitEthernet0
    ip address 10.0.0.1 255.255.255.0
     And is it ok to use the physical interface and sub-interface with dynamic routing such as EIGRP or OSPF etc?
    R1 Gi 0 ---- Point to Multipoint EIGRP or OSPF ---- Gi0 R2 / R3 
          Gi 0.20--- Point to Point EIGRP or OSPF --- Gi0.10 R4  (same VLAN-ID) 
    R1 - configuration
    interface GigabitEthernet0
     ip address 10.0.0.1 255.255.255.0
    interface GigabitEthernet8.20
     encapsulation dot1Q 20
     ip address 20.0.0.1 255.255.255.0
    Any information is very appreciated. but if there is any CCO document please let me know.
    Thank you very much and regards,
    Masanobu Hiyoshi

    Hello,
    The diagram is helpful.
    If I am getting you correctly, you have three routers interconnected by a switch, and you want them to operate in a hub-and-spoke fashion even though the switch is capable of allowing direct communication between any of these routers.
    Your first scenario is concerned with all three routers being in the same VLAN, and by using neighbor commands, you force these routers to establish targeted EIGRP adjacencies R1-R2 and R1-R3, with R1 being the hub.
    Your second scenario is concerned with creating one VLAN per spoke, having subinterfaces for each spoke VLAN created on R1 as the router, and putting each spoke just in its own VLAN.
    Your scenarios are not really concerned with the concept of native VLAN or the way it is configured, to be honest. Whether you use a native VLAN in either of your scenarios, or whether you configure the native VLAN on a subinterface or on the physical interface makes no difference. There is simply no difference to using or not using a native VLAN in any of your scenarios, and there is no difference to the native VLAN configuration being placed on a physical interface or a subinterface. It's as plain as that. Both your scenarios will work.
    My personal opinion, though, is that forcing routers on a broadcast multi-access segment such as Ethernet to operate in a hub-and-spoke fashion is somewhat artificial. Why would you want to do this? Both scenarios have drawbacks: in the first scenario, you need to add a neighbor statement for each spoke to the hub, limiting the scalability. In the second scenario, you waste VLANs and IP subnets if there are many spokes. The primary question is, though: why would you want an Ethernet segment to operate as a hub-and-spoke network? Sure, these things are done but they are motivated by specific needs so I would like to know if you have any.
    Even if you needed your network to operate in a hub-and-spoke mode, there are more efficient means of achieving that: Cisco switches support so-called protected ports that are prevented from talking to each other. By configuring the switch ports to spokes as protected, you will prevent the spokes from seeing each other. You would not need, then, to configure static neighbors in EIGRP, or to waste VLANs for individual spokes. What you would need to do would be deactivating the split horizon on R1's interface, and using the ip next-hop-self eigrp command on R1 to tweak the next hop information to point to R1 so that the spokes do not attempt to route packets to each other directly but rather route them over R1.
    I do not believe I have seen any special CCO documents regarding the use of physical interfaces or subinterfaces for native VLAN or for your scenarios.
    Best regards,
    Peter

  • What is the diffrence between My Runnable Interface and Java Runnable

    Hi folks
    all we know that interfaces in java just a decleration for methods and variables.
    so my Question is why when i create an interface its name is "Runnable" and i declared a method called "run" inside it.then when i implements this interface with any class don't do the thread operation but when i implement the java.lang.Runnable the thread is going fine.
    so what is the diffrence between My Runnable Interface and Java Runnable?
    thnx

    Hi folks
    all we know that interfaces in java just a decleration
    for methods and variables.
    so my Question is why when i create an interface its
    name is "Runnable" and i declared a method called
    "run" inside it.then when i implements this interface
    with any class don't do the thread operation but when
    i implement the java.lang.Runnable the thread is going
    fine.
    so what is the diffrence between My Runnable Interface
    and Java Runnable?
    thnxClasses and interfaces are not identified by just their "name", like Runnable. The actual "name" the compiler uses is java.lang.Runnable. So even if you duplicate the Runnable interface in your own package, it's not the same as far as the compiler is concerned, because it's in a different package.
    Try importing both java.util.* and java.awt.* (which both have a class or interface named List), and then try to compile List myList = new ArrayList();

  • Get CPU and memory usage

    Hi!
    I would like to know if there is any way of getting system CPU and memory usage using Java code.

    I want to get the system CPU and memory usage using the performance monitor dll, the perfctrs.dll, but access this data using Java language.Then you should create wrapper dll between your java code and perfctrs.dll and convert data from format of dll to format of your java code.
    So, that is next question - how to create wrapper dll, how to deal with or how perfctrs.dll works?

  • Scratch disks and RAM usage

    i would like to understand the relationship between scratch disks and RAM usage in Photoshop.
    While i was working on a fairly big psb file (2gb), photoshop kept prompting that I was out of memory, but in fact the utilization was only 75% (i had 16gbs total, photoshop was only using 7gb, and i allowed PS to use up to 14gb in total). when it says out of memory, it was actually my scratch disk at fault ( i only set 1 scratch disk, which was my 120gb SSD running out of space).
    any idea how I can optimize PS to use up all my RAM first before even touching my scratch disk? (short of using a RAMdisk, please).
    thanks!

    I am curious about this also. I just reinstalled W-7--have 11 G of physical memory--a ton of hard drive empty space also, and I have been wondering why PS_CC is so slow--since basically I have only put my Security and Browser in addition to Adobe back on the Dell XPS computer..... At least now it does show the downloading percentage (like .psd file) , but that must be what is happening.  I do think that some of these "frozen" screens I have been experiencing, was because the program was using scratch disk, instead of the Ram... I came up from CS-5, and can't describe it in detail, but just realize how slow PS-CC is in most everything.  Going back and see if reallocating will help...

  • How can we find the most usage and lowest usage of table in Sql Server by T-SQL

    how can we find the most usage and lowest usage of table in Sql Server by T-SQL
    The table has time stamp column
    StartedOn datetime
    EndedOn datetime

    The Below query has been used , but the textdata column doesnot include the name of the table ServiceLog.
    SELECT
    FROM
    databasename,
    duration
    fn_trace_gettable('F:\Program
    Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\log_148.trc',
    default)
    WHERE
    DATABASENAME='ZTCFUTURE'
    AND TEXTDATA
    IS
    NOT
    NULL
    --AND TEXTDATA LIKE 'SERVICE%'
    order
    by cpu
    desc; 

  • Question regarding roaming and data usage

    I am currently out of my main country of service, and as such I have a question regarding roaming and data usage.
    I am told that the airplane mode is sufficient from keeping the phone off from roaming, but does this apply to any background data usage for applications and such?
    If the phone is in airplane mode, are all use of the phone including wifi and application use through the wifi outside of all extra charges from roaming?

    Ann154 wrote:
    If you are getting charged to use the wifi, then it is possible.  Otherwise no
    Just to elaborate here, Ann154 is referring to access charges for wifi, which is nothing to do with Verizon, so if you are using it in a plane, hotel, an internet cafe etc that charges for Wifi rather than being free .   Verizon does not charge you (or indeed know about!) wifi usage, or any other usage that is not on their cellular network (such as using a foreign SIM for example in global phones)  So these charges, if any, will not show up on the verizon bill app.  Having it in airplane mode prevents all cellular data traffic so you should be fine

  • Portege M750 and Win8 - metro interface, and touchpad don't work

    For those of you that, as myself, tryed to install windows 8 in a Toshiba Portege M750 and had problems in portrait tablet mode I recommend the following driver it works perfectly:
    http://cdn.wacom.com/U/drivers/TabletPC/ISD_DualTouch_710-8.zip
    The problem I had was that swipe didn't work with metro interface, and touch didn't work also and in portrait, strangely, when you touch the secren two arrows with different directions woul appear.
    This driver solved my problem.
    Hope that this can help...

    Problem with wacom dual touch driver solved

  • Problem with memory usage and CPU usage

    Hello,
    i have a problem with the memory usage and cpu usage in my project!
    My application must run for more than 24 hrs. The problem is that the longer it runs the bigger is the memory and cpu usage!
    It starts with ~15% CPU usage and ~70 MBytes memory usage. After ~ 24hrs the CPU usage is ~60% and the memory usage is ~170 MBytes!
    After  3 days the CPU usage is almost about 70% and the memory usage is about 360 MBytes!
    What can I do to reduce this huge recource usage?
    Thank you!

    Hi Pahe,
       I think the issue is memory usage, since CPU usage can increase due to greater memory requirements.
       Anyway, it's difficult to debug without seeing your code, can you post it (possibly for LV 7.1 compatibility)?  Or just post a JPEG of the piece of code that can give problems...
       I guess you're appending data to an array instead of replace data elements, but I can't be sure...
       Have a nice day!
    graziano

Maybe you are looking for

  • Validation at Document Type level

    Dear Seniors, We have a requirement to have a validation for posing various documents by different users. Document type  JV should be posted by only a set of users USERS1. Document type GB should be posted by only a set of users USERS2. Document type

  • AME from After Effects?

    I have plug-ins that are only in AE (CS4) but would prefer to render using Adobe Media Encoder. If I export an Adobe Premiere project it won't carry with it the plug-in effects I assume. Whats the solution?

  • Winrar & unzipping files

    Hey people, I am encountering some problems on unzipping received file. I have downloaded winrar for mac from http://unrarx.com/ However I cant open the zipped file. I actually downloaded it and click on the unrarx icon. I tried to test and extractin

  • Function module create inbound delivery with text

    Hello I'm trying to create an inbound delivery with reference to a purchase order and create additional texts. I found FM GN_DELIVERY_CREATE but the texts are not added. I entered data in table IT_GN_TEXTL & IT_GN_TEXTH. What can be the problem? KR

  • Is it possible to run OS X Mountain Lion in a Virtual Machine on an AMD Processor?

    Hi guys, title says it all. Is it possible to run OS X Mountain Lion in a Virtual Machine on an AMD Processor? It is said that it only works on an Intel and I have an Intel computer but my AMD is the one I use for experimenting things such as this. T