GetMethod ambiguous because of bridge methods?

Hi,
I stumbled open this entry in the API.
It says that getMethod might find more than one matching method due to bridge methods with the same signature but different return type.
But according to the algorithm for finding a method described in the API, when several matching methods are found, the one with the most specific return type is chosen. What I don't get: is it even possible that a method and its bridge method have return types that are equivalent in terms of "specificity"?
Maybe I'm not creative enough, but can't manage to come up with an example. The type of the bridge method should always be more general than the type of the method it is supposed to bridge, because otherwise, in my experiments, a bridge method is not even generated in the first place.
Any help would be appreciated :)

mdux wrote:
Hi,
I stumbled open this entry in the API.
It says that getMethod might find more than one matching method due to bridge methods with the same signature but different return type.
But according to the algorithm for finding a method described in the API, when several matching methods are found, the one with the most specific return type is chosen. What I don't get: is it even possible that a method and its bridge method have return types that are equivalent in terms of "specificity"?
Maybe I'm not creative enough, but can't manage to come up with an example. The type of the bridge method should always be more general than the type of the method it is supposed to bridge, because otherwise, in my experiments, a bridge method is not even generated in the first place.
Any help would be appreciated :)The javadocs explain the following...
"Note that there may be more than one matching method in a class because while the Java language forbids a class to declare multiple methods with the same signature but different return types, the Java virtual machine does not."

Similar Messages

  • Hello my name is jose quant, and let me know how I can use CAMERA RAW adobe bridge because the bridge use and want to open a camera raw image, I get a message that says: MAIN BRIDGE aplicaion NOT ACTIVATED. BRIDGE REQUIRES A PARTICULAR PRODUCT HAS BEGUN A

    Hello my name is jose quant, and let me know how I can use CAMERA RAW adobe bridge because the bridge use and want to open a camera raw image, I get a message that says: MAIN BRIDGE aplicaion NOT ACTIVATED. BRIDGE REQUIRES A PARTICULAR PRODUCT HAS BEGUN AT LEAST ONCE TO ACTIVATE THIS FEATURE. I wonder what that means?
    I use a lapto (windows 7) 64-Bit operating system.
    Thank you,
    my email is: [email protected], if you send me the answer to my query

    You need to activate Photoshop.
    Mylenium

  • What is a "bridge method" ?

    The 1.5 reflection API has boolean Method.isBridge()
    The javadoc only says "returns true if and only if this method is a bridge method as defined by the Java Language Specification"..
    But i can't find any JLS-3 specification or anything else to indicate what a Bridge Method is...
    Do you know?

    Bridge methods are compiler generated methods used to implement covariant result types and other instances involving generic types. Here is an example that was posted in the generics forum:
    class Super<T> {
        public void foo(T t) {
            System.out.println("super");
    class Sub extends Super<String> {
        @Override
        public void foo(String t)  {
            System.out.println("sub");
    }Since the foo in the subclass has a different erasure, the compiler generates a bridge method that looks like this:
    public void foo(Object t) {
        foo((String)t);
    }This will ensure that the right method is called in this example:
    Super<String> s = new Sub();
    s.foo("Hello");This example would print "super" if the bridge method hadn't been there.

  • Are bridge methods generated for generic methods?

    I've recently come across the notion of bridge methods. They provide type safety while allowing for erasure. However, the only places where they've been mentioned is with your class extending a parameterized type. That is the only case mentioned with bridge methods in the JLS as well as:
    http://www.angelikalanger.com/GenericsFAQ/FAQSections/TechnicalDetails.html#Under which circumstances is a bridge method generated?
    So I've been wondering about generic methods. For example, Collections.max's signature looks like the following in the source:
    public static <T extends Object & Comparable<? super T>> T max(Collection<T> coll)
    and after erasure:
    public static Object max(Collection coll)
    However, one cannot simply pass any type of Collection to the max method, it must implement Comparable and whatnot. Therefore, my question is how does it do that? Mustn't there be some sort of bridge method or generic information in the class file? Else how can the compiler, by just looking at the erasure of generic methods, check type safety, do capture conversion, type inference, etc?

    Generic information is erased from the byte code. It is still there in the class file in the method signatures. That's how the compiler knows.

  • How to use java.lang.Class.getMethod() and java.lang.reflect.Method.invoke(

    I want to call a specified method of one class dynamically. I use the method
    "getMethod()" in package "java.lang.Class" to get method and "invoke()" in
    " java.lang.reflect.Method " to invoke method.
    The problem is as following :
    1. There are two argument in this method "getMethod(String MethodName , Class[] paremterTypes)" in package "Class". I have no idea about the second parameter " Class[] parameterTypes ".what does the argument exactly mean ?
    2. There are two argument in the method "invoke(object obj, object[] obj)" in package "Method".
    I have no idea about the second parameter "object[] obj ".what is mean ?
    I pass " null " value to it and it works.But i pass anothers ,jvm will throw exception.

    I have a generic Method Executer that has a method like
    public Object execute(String className, String methodName, Object args)
        String fullClassName = packageName + className ;
        Class delegateClass = Class.forName(fullClassName);
        BaseDelegate delegate = (BaseDelegate)delegateClass.newInstance();
        Method method = null;
        if (args == null)
            method = delegateClass.getMethod(methodName, new Class[] {});
            obj = method.invoke(delegate,new Object[] {});
        else
            method = delegateClass.getMethod(methodName, new Class[] {args.getClass()});
            obj = method.invoke(delegate, new Object[]{args});
       }This seems to have problems when I call the method from a class like:
    execute("CategoryDelegate", "getCategoryById", new Integer(4144));(I get a NoSuchMethodException)
    The method I am trying to execute in CategoryDelegate looks like:
    public Category getCategoryById(int categoryId) throws DelegateExceptionI think it has to deal with the difference in the way we handle Primitive Wrappers and Objects. Wrapper we have to use Interger.TYPE and with the rest of the Objects we have to use obj.class.
    Am I doing something wrong here? Any suggestions to make it work for primitive wrappers as well as Objects?

  • A have a float and i would like to be an int because of one method

    let be more detailed...
    i would like to do this : int i= (int) k ,k= float
    How can i do this without using convertion? there is method of that?
    Another problem that i have is that my program takes an argument from the command line. i take this argument into the constructor and then i am using in all my methods this line of command:
    float k= Float.valueOf(arg).floatValue();//i want float because of the problem.
    is it right that?can i do something else? there is a method for this,too?
    thanks

    i am sorry for my formatting.
    i mean that it can catch the error .I have a print command but it is not appear.But the previous print command has an output.is that ok?
    try
    float arg = Float.parseFloat( args );
    if( args.length==0)
    System.out.println("Close Window");//has an output
    catch(ArrayIndexOutOfBoundsException e)
    System.out.println("Caught ArrayIndexOutOfBounds Exception" + e);
    //it is not appear,so it did not catch it the error
    }

  • Not getting MY iPhone 6 Plus I ordered on 9/12. seems that if you Billed to Account, they pulled the entire purchase price from any credit/debit card that you used to purchase the phone. Well in my case, the order didn't go thru because the payment method

    Have you gotten your iPhone 6 Plus you pre-ordered on 9/12?? I'm still waiting...till the end of OCTOBER! Because, I billed half to my account, as the system LET me do this and the other half to my debit card. Well they tried to take out the FULL PURCHASE PRICE on 9/23. It didn't go thru and they cancelled the order! I NEVER GOT ANY EMAIL from Verizon! I called this evening to find out the status of my order. Was told that since the device is on backorder, I cannot Bill to Account!!!! I am BEYOND LIVID! I realize that it's "JUST A PHONE' BUT, I should have had my device by Friday! NOW, I have to wait another month at best. I do NOT have credit cards and since this phone is on backorder, will have to wait another week before I can order it and by that time, it'll be CHRISTMAS before I can order a phone. Who knows, I may just save that money and CANCEL EVERY SINGLE LINE on my account. Three will be Month to month so NO ETF's with those lines!

    its a bunch of **. they charged my credit card on sunday, my status still says no payment, no tracking #, they told me my phone was going to ship monday and I've gotten a different story every day since. today they told me they shipped out all the phones and are waiting for more to come in...blah blah blah. i ordered on 9/12 and my friend that ordered the same exact phone on 9/19 got his on tuesday and laughed at me for preordering. I'm very frustrated!

  • Will Not Update because of Bridge???

    New system, Windows 7, 64 Bit, PS CS4 installed, but three UPDATES will not install.  Screens says to close Bridge, HUH???  PS CS4 is not running.  Any ideas???  I tried to manually load the RAW update, but it to says I need to close Bridge.  I am stumped, can anyone help???

    The system is probably set to autoload bridge on startup so it is running in the backrgound.  Disable this feature.
    Open Task Manager and click on the processes tab.  Check to see if Bridge.exe is running.  If so stop program.

  • Debug output for ActiveX Bridge

    I'm using j2sdk1.4.2. I've tried System.out and a custom logger. Nothing shows up in the Java Console and nothing seems to appear on disk. Anyone know the super secret squirrel trick to debug one of these?

    I'm using my bridge object as a (silent)
    'var obj = new ActiveXObject(myobj.Bean)'
    in a browser. When I register with the packager then I see output in the 'cmd' session from my constructor. I do not, however, ever see any output from the 'sun java console' that is associated with the browser. My bridge methods are getting called. I know because I've resorted to returning a comment string back to the browser, e.g.
    <!-- setChannel returned success! -->
    Which, IMHO, is a pretty lame way to have to debug.
    Thanks for help

  • Numeric method parameters & reflection

    Hi everyone,
    I have a rather interesting problem for you...
    I'm writing a program that will allow a user to call bean methods declaratively (i.e. in an XML doc) for any arbitrary bean. My problem is determining how to treat numeric parameter values. If a user wants to call doSomething(5), how do I know what Class type I need to pass in so that 5 matches the formal parameter type of the method being called? The actual parameter could be considered a byte, int, long, float or double.
    Here's an example:
    import java.lang.reflect.*;
    public class ReflectTest
       public ReflectTest()
          try
             Class[] typeList = new Class[1];
             Object[] paramList = new Object[1];
             typeList[0] = Integer.TYPE;
             paramList[0] = new Integer(6);
             Method method = getClass().getMethod("doSomething",typeList);
             Object ret = method.invoke(this,paramList);
             System.out.println(ret.toString());
           catch(Exception ex)
             ex.printStackTrace();
       public String doSomething(int x)
          return "x="+x;
       public static void main(String[] args)
          ReflectTest reflectTest = new ReflectTest();
    }This example works. But let's suppose the method signature was doSomething(long x). The getMethod() call would fail, because I had passed it a parameter of Integer.TYPE, and not Long.TYPE. Ironically, you could leave the call to invoke() as-is, it handles the widening automatically. Any ideas on how to go about this??
    Thanks!

    I'm writing a program that will allow a user tocall
    bean methods declaratively (i.e. in an XML doc) for
    any arbitrary bean. My problem is determining howto
    treat numeric parameter values. If a user wants to
    call doSomething(5), how do I know what Class typeI
    need to pass in so that 5 matches the formalparameter
    type of the method being called?When you say "call bean methods", I assume you mean
    that you are setting properties on a JavaBean? If so,
    then use the java.beans.Intospector
    Also take a look at [url
    http://jakarta.apache.org/commons/beanutils.html]the
    Jakarta Commons BeanUtils libraryThanks, I think that the MethodUtils class might solve my problem.

  • Ambiguous reference???

    class A {
    void m1(A a) {System.out.print("A");}
    class B extends A {
    void m1(B b) {System.out.print("B");}
    class C extends B {
    void m1(A c) {System.out.print("C");}
    class D {
    public static void main(String[] args) {
    A a1 = new A();
    B b1 = new B();
    C c1 = new C();
    A c2 = new C();
    c2.m1(a1);
    c1.m1(b1); //THIS IS A COMPILER ERROR???
    c2.m1(b1); //THIS IS FINE???
    c2.m1(c1);
    The compiler says that the reference is ambiguous??? I don't see why it just doesn't call m1(B b){} from class B which it inherits??? When the refernce c2 is used, the compiler does not mind??? Any ideas?

    I don't know about the errors in which JDK versions, but I think I know why it's ambiguous...
    Class C extends B, which extends A. When you overload the methods from a super class, you can still call those methods. In this case, by passing an B object to the C's method, it's ambiguous because the compiler isn't sure if you want to call the C.m1(A) method or the B.m1(B) method. Now, it seems to me that it should just assume a call to the C.m1(A) method, casting the B to an A object internally (or whatever it does). What's curious to me is that the "c2.m1(b1);" you are making, in effect, is doing the same thing. It's still supposed to call C class method, regardless that the C object is held in an A variable. Seems likely also that if you change it to this: c1.m1((A)b1); ... it'd work also.
    On the other hand, it's probably benificial all around to avoid writing code like this because it's also (to me) a little ambiguous to people reading the code. I don't mean the A, B, C class names, but the overloading methods this way.

  • Class.getMethod using a superclass

    I'm trying to use Class.getMethod to retrieve a particular method, but it keeps returning NoSuchMethodException s when i use code similar to this example.
    try {
         Class<?> c = Class.forName("javax.swing.JFrame");
         Method m = c.getMethod("add",javax.swing.JButton.class);
    catch(Exception e) {
         e.printStackTrace();
    }I think it is unable to find the method because the add method takes a java.awt.Component, but is there any way around casting it to that? The method names and arguments are only provided at runtime, and the only solution I see is successive calls to Class.getSuperClass and testing the parameter over and over again to try to find the right method. This doesn't seem like a good solution, or even efficient, when considering the combinations you would have to attempt when given multiple parameters.
    Is there a better way to solve this than that?

    Hi,
    I do not see a solution like the one you are looking for (automatic matching). But what may be easier than your proposed solution of successive calls to getMethod() with different combinations of parameter types, and each call throwing NoSuchMethodExceptions, may be something like:
    - call getMethods()
    - iterate over all methods found
    - first matching names
    - for each matching name, check parameter type (of course not equality, but whether your type would fit the type expected by the method)
    - repeat for each parameter of current match
    - repeat until matching method is found
    Bye.

  • Java.nio select() method return 0 in my client application

    Hello,
    I'm developing a simple chat application who echo messages
    But my client application loop because the select() method return 0
    This is my code
    // SERVER
    package test;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    public class Server {
         private int port = 5001;
         public void work() {               
              try {
                   ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
                   serverSocketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(port);               
                   serverSocketChannel.socket().bind(isa);
                   Selector selector = Selector.open();
                   serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);
                   System.out.println("Listing on "+port);
                   while(selector.select()>0) {
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();) {
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isAcceptable()) {
                                  ServerSocketChannel keyChannel = (ServerSocketChannel)key.channel();                              
                                  SocketChannel channel = keyChannel.accept();
                                  channel.configureBlocking(false);                              
                                  channel.register(selector, SelectionKey.OP_READ );
                             } else if (key.isReadable()) {
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  String m = Help.read(keyChannel );
                                  Help.write(m.toUpperCase(), keyChannel );
              } catch (IOException e) {                                             
                   e.printStackTrace();                         
         public static void main(String[] args) {
              Server s = new Server();
              s.work();
    // CLIENT
    package test;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class Client extends JFrame  {
         private String host = "localhost";
         private int port = 5001;
         private SocketChannel socketChannel;
         private Selector selector;
         public void work() {               
              try {
                   socketChannel = SocketChannel.open();
                   socketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(host, port);               
                   socketChannel.connect(isa);
                   selector = Selector.open();
                   socketChannel.register(selector, SelectionKey.OP_CONNECT | SelectionKey.OP_READ );
                   while(true) {
                        selector.select();
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();) {
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isConnectable()) {
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  if (keyChannel.isConnectionPending()) {
                                       System.out.println("Connected "+keyChannel.finishConnect());                                                                           
                             } else if (key.isReadable()) {                                                                                                                                                           
                                  SocketChannel keyChannel = (SocketChannel) key.channel();                                             
                                  String m = Help.read(keyChannel);
                                  display(m);                                                                                                                                                                                                                   
              } catch (IOException e) {                                             
                   e.printStackTrace();                         
         private void display(final String m) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        area.append(m+"\n");
                        textFieed.setText("");
         private void sendMessage(final String m) {
              Thread t = new Thread(new Runnable() {               
                   public void run() {                                                                                
                        try {                         
                             Help.write(m, socketChannel);
                        } catch (IOException e) {               
                             e.printStackTrace();
              t.start();                    
         public Client() {
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(1);
              textFieed.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode()== KeyEvent.VK_ENTER) {
                             String m = textFieed.getText();
                             sendMessage(m);     
              area.setEditable(false);
              getContentPane().add(textFieed, "North");
              getContentPane().add(new JScrollPane(area));
              setBounds(200, 200, 400, 300);
              show();
         private String messageToSend;
         private JTextArea area = new JTextArea();
         JTextField textFieed = new JTextField();
         public static void main(String[] args) {
              Client s = new Client();
              s.work();
    // HELPER CLASS
    package test;
    import java.io.IOException;
    import java.nio.ByteBuffer;
    import java.nio.CharBuffer;
    import java.nio.channels.SocketChannel;
    import java.nio.charset.Charset;
    import java.nio.charset.CharsetDecoder;
    import java.nio.charset.CharsetEncoder;
    public class Help {
         private static Charset charset = Charset.forName("us-ascii");
         private static CharsetEncoder enc = charset.newEncoder();
         private static CharsetDecoder dec = charset.newDecoder();
         private static void log(String m) {
              System.out.println(m);
         public static String read(SocketChannel channel) throws IOException {
              log("*** start READ");                              
              int n;
              ByteBuffer buffer = ByteBuffer.allocate(1024);
              while((n = channel.read(buffer)) > 0) {
                   System.out.println("     adding "+n+" bytes");
              log("  BUFFER REMPLI : "+buffer);
              buffer.flip();               
              CharBuffer cb = dec.decode(buffer);          
              log("  CHARBUFFER : "+cb);
              String m = cb.toString();
              log("  MESSAGE : "+m);          
              log("*** end READ");
              //buffer.clear();
              return m;                    
         public static void write(String m, SocketChannel channel) throws IOException {          
              log("xxx start WRITE");          
              CharBuffer cb = CharBuffer.wrap(m);
              log("  CHARBUFFER : "+cb);          
              ByteBuffer  buffer = enc.encode(cb);
              log("  BUFFER ALLOUE REMPLI : "+buffer);
              int n;
              while(buffer.hasRemaining()) {
                   n = channel.write(buffer);                         
              System.out.println("  REMAINING : "+buffer.hasRemaining());
              log("xxx end WRITE");

    Here's the fix for that old problem. Change the work method to do the following
    - don't register interest in things that can't happen
    - when you connect register based on whether the connection is complete or pending.
    - add the OP_READ interest once the connection is complete.
    This doesn't fix all the other problems this code will have,
    eg.
    - what happens if a write is incomplete?
    - why does my code loop if I add OP_WRITE interest?
    - why does my interestOps or register method block?
    For code that answers all those questions see my obese post Taming the NIO Circus
    Here's the fixed up Client code
    // CLIENT
    package test
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class Client extends JFrame  {
         private String host = "localhost";
         private int port = 5001;
         private SocketChannel socketChannel;
         private Selector selector;
         public void work() {
              try {
                   socketChannel = SocketChannel.open();
                   socketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(host, port);
                   socketChannel.connect(isa);
                   selector = Selector.open();
                   int interest = 0;
                   if(socketChannel.isConnected())interest = SelectionKey.OP_READ;
                   else if(socketChannel.isConnectionPending())interest = SelectionKey.OP_CONNECT;
                   socketChannel.register(selector, interest);
                   while(true)
                        int nn = selector.select();
                        System.out.println("nn="+nn);
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();)
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isConnectable())
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  System.out.println("Connected "+keyChannel.finishConnect());
                                  key.interestOps(SelectionKey.OP_READ);
                             if (key.isReadable())
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  String m = Help.read(keyChannel);
                                  display(m);
              } catch (IOException e) {
                   e.printStackTrace();
         private void display(final String m) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        area.append(m+"\n");
                        textFieed.setText("");
         private void sendMessage(final String m) {
              Thread t = new Thread(new Runnable() {
                   public void run() {
                        try {
                             Help.write(m, socketChannel);
                        } catch (IOException e) {
                             e.printStackTrace();
              t.start();
         public Client() {
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(1);
              textFieed.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode()== KeyEvent.VK_ENTER) {
                             String m = textFieed.getText();
                             sendMessage(m);
              area.setEditable(false);
              getContentPane().add(textFieed, "North");
              getContentPane().add(new JScrollPane(area));
              setBounds(200, 200, 400, 300);
              show();
         private String messageToSend;
         private JTextArea area = new JTextArea();
         JTextField textFieed = new JTextField();
         public static void main(String[] args) {
              Client s = new Client();
              s.work();

  • HT201359 I was using a prepaid MasterCard, the card now has a zero balance. I an unable to download any free games? How do I delete the card from my pay method so I can down load free apps?

    I used a prepaid MasterCard as my pay method, the card now has a zero balance. My I pad will no longer allw my to download free apps because my pay method is invalid?  I can't delete the paymethodwith out putting in a new one?  How can I download free ps

    Changing Account Information
    http://support.apple.com/kb/HT1918
    If necessary Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Class extending a Frame with main method in it - how do I use the methods?

    Howdy.
    Having a problem.. I want my "main" class, ie. the class with the main method in it to extend a Frame class.. because the main method is static, I can't use Frame's methods.
    What's a trick to get around this ? I am making a deliberate design decision to extend the Frame class, because I thought it was.. well.. better. I could always just create a Frame object and utilise it.. but from little things I've read and seen it's better to extend it.
    When I use Forte to make a Frame program it sets up a constructor/etc. for the main class and then it does something akin to this (the class is called MazeGenerator) :
    public static void main(String args[]) {
    new MazeGenerator().show();
    What does "new MazeGenerator().show();" do when it's not being associated to an object handle ??
    Ta.
    - Scutt.

    Create an instance of the frame in main then the constructor can control it. Or you could add an init method or something:
    class MyFrame extends Frame {
    public static void main (String [] args) {
    MyFrame frame = new MyFrame();
    frame.init();
    You don't necessarily have to have a reference to an Object in order to create one. All the work can be done in the constructor (something I'm not really fond of however)

Maybe you are looking for

  • Data  not available in infocube

    hi all, I havae an Infocube for which data is coming from the ods. yesterday i found the data is not available for an info object in ods for which data is there in source system. then I manually enter the data in the ods and today morning when i chec

  • A different way to deal with "unknown" user after upgrade from Tiger.

    It's a known issue that doing upgrade and install or archive and install from Tiger to Leopard, produces a lot of folders with "unknown" group in their "get info" panel. This has to do with a different group structure in Tiger and Leopard. In Tiger,

  • Dynamic File Name in a Read File

    Hello there. I have a need and I don't know if there is possible in Oracle BPEL 10.1.3. I need to read a different file, based on the name of it. So, I need that the file name defined in the adapter is defined dynamically in run time, based in the na

  • How to view the result of any SQL script

    Hi I am working on Oracle 10 g Express Edition.I have an explicit cursor code ,a very basic one.I want to know how can i view result of the script.When i Save and run the script i get nothign on the window. I am pasting the script for the Reference.

  • "TimestampDiff" function error

    Hi, case when TimestampDiff(YEAR, BIRTH_DT, '2009-07-06 00:00:00.000') < 18 then 'A: <18' end above query throws error in oracle, This function "TimestampDiff" is not in oracle. How it make above query in oracle? Please help me. Thanks.