Java.util.vector package

What is in the java.util.vector package and why is it used (imported)?
Thanks

Can you tell me what the Vector class is use for?First of all, forget about Vector. When anyone mentions Vector, your response should be "You're still using Vector? Are you still in 1.1?"
Use ArrayList. It's basically the same but better. It's a List. You know what a List is right? It's a group or ordered items that can contain duplicates. An ArrayList is basically a List that is backed by an array. The greate thing about it is that it automatically makes itself bigger as needed and implements probably the most commonly supported Java type: Collection.

Similar Messages

  • Any benefit to import java.util.Vector over import java.util.*?

    By benefit I mean does it reduce compile time or have some other beneficial side effect to import only those classes you're using in a class rather than importing the package they reside in.
    For example:
    // this?
    import java.util.Vector;
    // or this..
    import java.util.*;
    class Test
         Vector v;
    }Question is strictly academic...I'm just curious.

    I like Dr. clap's answer. Also, though you can
    consider code readability. Obviously importing a
    whole package doesn't give you an idea of what classes
    are being used. "I", personally, have only seen exact
    class imports done when learning something new. This
    is basically just for clarity, and not speed as Dr.
    Clap pointed out.That's probably a good thing to do for examples, but I can't see why you would want to know what individual classes are being used otherwise.
    From a programming standpoint if you're going to build a complex dialog you don't want 500 import statements. If you know you're going to be using lots of classes from an individual package might as well import the whole thing.

  • Help needed to solve "java.io.NotSerializableException: java.util.Vector$1"

    hi to all,
    i am using a session less bean A to querry a Entity Bean B , which inturns calls another EntityBean C ,
    finally a ' find' method is invoked on the EntityBean C, In this a vector is created which holds 3 different vectors at different indexes, now the problem i am facing is that when Enity Bean B is returning the final vector to the A , it's firing out a errors that :-
    TRANSACTION COULD NOT BE COMPLETED: RemoteException occurred in server thread;
    ested exception is:
    java.rmi.RemoteException: null; nested exception is:
    java.rmi.ServerException: RemoteException occurred in server thread; ne
    ted exception is:
    java.rmi.RemoteException: null; nested exception is:
    java.io.NotSerializableException: java.util.Vector$1
    java.rmi.ServerException: RemoteException occurred in server thread; nested exc
    ption is:
    java.rmi.RemoteException: null; nested exception is:
    java.rmi.ServerException: RemoteException occurred in server thread; ne
    ted exception is:
    java.rmi.RemoteException: null; nested exception is:
    java.io.NotSerializableException: java.util.Vector$1
    java.rmi.RemoteException: null; nested exception is:
    java.rmi.ServerException: RemoteException occurred in server thread; ne
    ted exception is:
    java.rmi.RemoteException: null; nested exception is:
    java.io.NotSerializableException: java.util.Vector$1
    java.rmi.ServerException: RemoteException occurred in server thread; nested exc
    ption is:
    java.rmi.RemoteException: null; nested exception is:
    java.io.NotSerializableException: java.util.Vector$1
    java.rmi.RemoteException: null; nested exception is:
    java.io.NotSerializableException: java.util.Vector$1
    java.io.NotSerializableException: java.util.Vector$1
    <<no stack trace available>>
    ur any help would be highly appricated to solve out this prob.
    If i try to iterate through this vector it's gives IOR:0232003x343242344asdsd................................................blabla....................
    thanxs in adavance
    Deepak

    Hi I think you are using the method elements() in a remote method.
    This method can't be Serializable!! Because it returns an Interface. Interfaces are never Serializable.
    Regards,
    Peter

  • Using ExecutorService class from java.util.concurrent package

    Dear java programmers,
    I have a question regarding the ExecutorService class from java.util.concurrent package.
    I want to parse hundreds of files and for this purpose I'm implementing a thread pool. The way I use the ExecutorService class is summarized below:
    ExecutorService executor = Executors.newFixedThreadPool(10);
            for (int i = 0; i < 1000; i++){
                System.out.println("Parsing file No "+i);
                executor.submit(new Dock(i));
            executor.shutdown();
            try {
                executor.awaitTermination(30, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();However, the code snippet above creates all the 1000 threads (Dock objects) at once and loads them to the executor, and thus I'm worrying about memory leak. I haven't tested it on 1000 files yet but just on 50 small ones, and even if the program prints out "Parsing file No "+i 50 times at once, it executes normally the threads in the background.
    I guess the write way would be to keep the number of active/idle threads in the executor constant (lets say 20 if the thread pool's size is 10) and submit a new one whenever a thread has been finished or terminated. But for this to happen the program should be notified someway whenever a thread is done. Can anybody help me do that?
    thanks in advance,
    Tom

    Ok I found a feasible solution myself although I'm not sure if this is the optimum.
    Here's what I did:
            ExecutorService executor = Executors.newFixedThreadPool(10);
            Future<String> future0, future1, future2, future3, future4, future5, future6, future7, future8, future9;
            Future[] futureArray = {future0 = null, future1 = null, future2 = null, future3 = null, future4 = null, future5 = null,
            future6 = null, future7 = null, future8 = null, future9 = null};
            for (int i = 0; i < 10; i++){
                futureArray[i] = executor.submit(new Dock(i));
            }I created the ExecutorService object which encapsulates the thread pool and then created 10 Future objects (java.util.concurrent.Future) and added them into an Array.
    For java.util.concurrent.Future and Callable Interface usage refer to:
    [http://www.swingwiki.org/best:use_worker_thread_for_long_operations]
    [http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter10/concurrencyTools.html]
    I used a Future[] Array to make the code neater. So after that I submitted -and in this way filled up- the first 10 threads to the thread pool.
            int i = 9;
            while (i < 1000){
                for (int j = 0; j < 10; j++){
                    if (futureArray[j].isDone() && i < 999){
                        try{
                            i++;
                            futureArray[j] = executor.submit(new Dock(i));
                        } catch (ExecutionException ex) {
                            ex.printStackTrace();
                        } catch (InterruptedException ex) {
                            ex.printStackTrace();
                try {
                    Thread.sleep(100); // wait a while
                } catch(InterruptedException iex) { /* ignore */ }
            executor.shutdown();
            try {
                executor.awaitTermination(60, TimeUnit.SECONDS);
            } catch (InterruptedException ex) {
                ex.printStackTrace();
            executor.shutdownNow();
        }Each of the future[0-9] objects represents a thread in the thread pool. So essentially I'm check which of these 10 threads has been finished (using the java.util.concurrent.Future.isDone() method) and if yes I replenish that empty future[0-9] object with a new one.

  • Problems with protected access in java.util.vector

    Hi,
    basically i'm trying to use the method removeRange(int,int) of class Vector from the java API.
    I keep getting the following compiler message:
    removeRange(int,int) has protected access in java.util.vector.
    This seems rather vague, and i don't know quite what to do?
    Thanks in advance

    removeRange(int,int) has protected access in java.util.vector.
    This seems rather vague, and i don't know quite what to do?As error messages go, that's pretty clear: method removeRange is a protected method and you can only call public ones of Vector, right? You can always combine subList and clear:
    vec.subList(fromIndex, toIndex).claer();

  • Service component:  java.lang.NoSuchMethodException: java.util.Vector.isX()

    Hi everybody:
    I created a Mobile service component and a Data Structure with 3 attributes. I created and instantiated the collection and showed all objects in a table but I´m getting the following error:java.lang.NoSuchMethodException: java.util.Vector.isX() where X is the name of the each attribute I defined. so I´m getting this error twice for each attribute.
    Complete stack:
    java.lang.NoSuchMethodException: java.util.Vector.isX()
         at java.lang.Class.getMethod(Class.java:1581)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.JavaBeanCMIModel.invokeMethod(JavaBeanCMIModel.java:366)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.JavaBeanCMIModel.invokeGetMethod(JavaBeanCMIModel.java:279)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.JavaBeanCMIModel.getAttributeValue(JavaBeanCMIModel.java:81)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.NodeElement.getAttributeValue(NodeElement.java:104)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.NodeElement.getAttributeValue(NodeElement.java:85)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.NodeElementWrapper.getAttributeValue(NodeElementWrapper.java:26)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNode.getAttributeValue(ContextNode.java:578)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNode.getAttributeValue(ContextNode.java:569)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNodeMapped.getAttributeValue(ContextNodeMapped.java:134)
         at com.sap.tc.mobile.wdlite.progmodel.core.viewelement.Property.listenContextNodeCursorChanged(Property.java:173)
         at com.sap.tc.mobile.wdlite.progmodel.core.context.ContextNode.addContextNodeElementListener(ContextNode.java:616)
         at com.sap.tc.mobile.wdlite.progmodel.core.viewelement.Property.setBinding(Property.java:73)
         at com.sap.tc.mobile.wdlite.progmodel.core.viewelement.Property.setBinding(Property.java:57)
         at com.xioma.demo.testeui0001.comp1.Comp1ViewView.(Comp1ViewView.java:615)
         at com.xioma.demo.testeui0001.comp1.Comp1ViewView.getInstance0(Comp1ViewView.java:31)
         at com.xioma.demo.testeui0001.comp1.Comp1ViewView.getInstance(Comp1ViewView.java:45)
         at com.xioma.demo.testeui0001.comp1.Comp1WindowWindow.getDefaultView(Comp1WindowWindow.java:38)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:477)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:243)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.setCurrent(Application.java:119)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:143)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)
         at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:387)
         at com.sap.tc.mobile.wdlite.container.ContainerApp.startApp(ContainerApp.java:155)
         at com.sap.tc.mobile.wdlite.container.AppMenuView.onActionLaunchApp(AppMenuView.java:327)
         at com.sap.tc.mobile.wdlite.container.AppMenuView.invokeEventHandler(AppMenuView.java:370)
         at com.sap.tc.mobile.wdlite.progmodel.core.AbstractViewElement.doHandleEvent(AbstractViewElement.java:207)
         at com.sap.tc.mobile.wdlite.renderer.api.UIElement.doHandleEvent(UIElement.java:399)
         at com.sap.tc.mobile.wdlite.renderer.api.UIImageButton.mouseReleased(UIImageButton.java:148)
         at com.sap.tc.mobile.wdlite.renderer.api.UIElement.dispatchMouseReleasedWidgetEvent(UIElement.java:442)
         at com.sap.tc.mobile.wdlite.renderer.api.UIElement$1.mouseReleased(UIElement.java:485)
         at com.sap.tc.mobile.wdlite.renderer.swt.MouseEventDispatcher.mouseUp(SWTControl.java:362)
         at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137)
         at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
         at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
         at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
         at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
         at com.sap.tc.mobile.wdlite.renderer.swt.container.WorkingArea.refresh(WorkingArea.java:175)
         at com.sap.tc.mobile.wdlite.renderer.api.RenderingManager.refresh(RenderingManager.java:233)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.refresh(Application.java:250)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:503)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:243)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.setCurrent(Application.java:119)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:143)
         at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)
         at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:387)
         at com.sap.tc.mobile.wdlite.framework.Start.runOnContext(Start.java:585)
         at com.sap.tc.mobile.wdlite.framework.Start.startApplication(Start.java:609)
         at com.sap.tc.mobile.wdlite.framework.Start.startContainer(Start.java:646)
         at com.sap.tc.mobile.cfs.framework.spi.FrameworkManager.startContainer(FrameworkManager.java:259)
         at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:230)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)
    The errors are throw when the application starts, the custom code works ok.
    Any idea?
    Thanks a lot for your time on this thread.
    Rocío.

    Ho Rocio,
    The creme JVM is compatible with JDK 1.3.Please make sure that the API you are using is available in 1.3 API set.
    Best Regards,
    Amit

  • Java.io.NotSerializableException: java.util.Vector$1

    I am using Java 2 in the API it says that the Vector implements Serializable but I am getting an exception java.io.NotSerializableException: java.util.Vector$1 I don't know why please help.
    Thank you
    palanisr

    Although Vectors are Serializable that doesn't mean that the contents of a Vector are necessarily Serializable. What are the contents of your Vector? Are they objects of a Serializable class? If not that is your problem. The attached sample code demonstrates the problem of serializing a Vector that contains non-serializable data. If you make the Employee class Serializable the code works.
    import java.util.*;
    import java.io.*;
    public class Serialize
    public static void main(String args[])
      ObjectOutputStream oos = null;
      FileOutputStream fos = null;
      Vector v = new Vector();
      v.add(new Employee("Smith","John"));
      v.add(new Employee("Jones","Albert"));
      try
       fos = new FileOutputStream("vector.ser");
       oos = new ObjectOutputStream(fos);
       oos.writeObject(v);
      catch(FileNotFoundException fnfe)
       fnfe.printStackTrace();
      catch(IOException ioe)
       ioe.printStackTrace();
      finally
       try
        if (oos != null)
         oos.close();
       catch(IOException ioe)
       try
        if (fos != null)
         fos.close();
       catch(IOException ioe)
    class Employee //implements Serializable
    private String lastName;
    private String firstName;
    public Employee(String lastName, String firstName)
      this.lastName = lastName;
      this.firstName = firstName;
    }

  • Java.lang.NoSuchMethodError: java/util/Vector method revove...

    After using jexegen from microsoft to make EXE. I receive this error when i execute the my EXE :
    java.lang.NoSuchMethodError: java/util/Vector method revove...
    Any body know why?
    If i execute from JBuilder i have no problem!

    hi, i don't have much experience with M$ java products, but as far as i remember, M$ java stopped developping since jdk 1.1.4 (or 1.1.7).
    maybe that's the reason for throwing this exception. if you want to "exe" your class-file, try JToExe.
    greetzzz
    chris

  • Throw "java.util.Vector" exception?

    In my servlet, I got catch(Throwable t), t.getMessage() is java.util.Vector. Can anyone tell me where I should look into for this problem?

    probably a ClassCastException. Why don't you get the stack trace?

  • Modifying JAR file using java.util.jar package  over the network

    Hello,
    I am modifying a JAR file programmatically using java.util.jar package. The time taken to save the contents to a local disk is very less (around 1 sec) . When I tried modifying the JAR from a remote machine over the network (from mapped drive or shared folder of WIN NT), the time taken to save is 15-20 times more.
    I am recreating the whole JAR while modifying. Is there any way to improve the performance. Or is it possible to write only the changed files?
    Thanks,
    Prasad Y S.

    When you "update" a jar file, you must always recreate it from scratch.

  • Java.util.Vector

    Hello,
    I keep getting this error message, although things used to work fine before.
    Error : Method toArray(SecurityConstraint[]) not found in class java.util.Vector.
    PolicyEnforcer.java line 36
    Snippet of code
    import java.util.*;
    //blabla
    Vector constraints = inv.getConstraints();
    SecurityConstraint [] constr = (SecurityConstraint [])constraints.toArray(new SecurityConstraint[0]);Any ideas what could be wrong??
    thanx

    Hi,
    Why not try this:
      SecurityConstraint[] constr = (SecurityConstraint[])                                       
        constraints.toArray( new SecurityConstraint[constraints.size()] );HTH
    ~Bill

  • Java.util.vector value to String

    Hi
    I am trying to use some API calls for securecomputing. One of the value when i print using API, i get the result as
    java.util.Vector$1@93d6bc
    How do i convert this value into readable string format.
    Thanks for any help
    Joseph

    Even after adding toString() it still returns the
    same value.
    System.out.println("Role " +
    (user.getValue(User.IDS_ROLE)).toString());
    Returns "Role java.util.Vector$1@93d6bc"
    User.IDS_ROLE is an int
    Thanks for the repliesWe didn't mean for you to explicitly call toString(), we meant for you to implement it. What kind of class does user.getValue(int) return? Surely it's not a java.util.Vector, but something else - what it is returning looks confusing (java.util.Vector$1...)

  • ClassCastException: java.util.Vector

    I'm trying to get a list of records(products) from the dataBase and print them into a jsp page.
    Here is the code-
    Method in session bean to get the records-
    public List<Entity.Products> getProducts(int categoryId)
          Query query=manager.createNativeQuery("select * from products  where categoryId="+categoryId);
          return (List<Entity.Products>)query.getResultList();
        }I put the result in the request (in a servlet)-
       request.setAttribute("products",productsManagement.getProducts(categoryId));JSP page-
          <%
             java.util.List<Entity.Products> products=(java.util.List<Entity.Products>) request.getAttribute("products");
              for(Entity.Products product : products)
               %>
            <A href=""><%=product.getProductName()%></A>
               <%
               %>The problen is that i'm getting the error-
    java.lang.ClassCastException: java.util.Vector
    what is the problem?
    Thanks in advanced.

    ppl1,
    Your problem is with createNativeQuery. Native query returns a Vector of objects. Whereas createNamedQuery (based on JPQL) is smart enough to get the types right. It seems like you want to use createNamedQuery which will allow you to use generics with the Entity type.
    For example, with a client
    List<Products> products = prodMgr.findAllProducts();
    for(Product p : products) {
    System.out.println(p");
    }The following session bean will work.
    // ProdManager
    @PersistenceContext EntityManager em;
    public List<Product> findAllProducts() {
      // JPQL for findAllDepts: SELECT p FROM Product AS p
      return em.createNamedQuery("findAllDepts");
    }If you are committed to native query, use the following on the client and EJB respectively.
    List products = prodMgr.findAllProducts();
    for( Object obj : products ) {
      System.out.println( obj.toString());
      // use a case "(Product)obj" for field-level access
    List findAllProducts() {
    return em.createNativeQuery("SELECT * FROM products").getResultList();
    }

  • Differences on Windows and Linux JVM about java.util.zip package

    Hello, there!
    I need some help if someone else has already face this problem.
    I have a Java server that process the bytes of a SWF File stored in the server and ouptut it to the user through a Servlet. The file was decompressed and re-compressed using the java.util.zip package (Deflater/Inflater).
    Everything works fine on Windows Server 2008 server. But now we need to migrate the server to Linux. The problem is that when I test the website now, the file seens to be corrupted.
    What really intrigues me is that everything runs normal on Windows Server configuration, when changed to Linux, the final file seens to be corrupeted... what could possible be the cause? Is there any difference between java.util.zip package on Window and Linux JVM?
    My Windows Server is:
    . Windows Server 2008 (6.0 - x86)
    . Apache 2.2.11
    . Tomcat 6.0.16.0
    . Java JDK 1.6.0_12-b04
    My CentOS Server is
    . CentOS 5.4 (2.6.18-164.15.1.el5 - i386)
    . Apache 2.2.3
    . Tomcat 6.0.16.0
    . Java JDK 1.6.0_12-b04
    Please, if someone could give me a lead, I would appreciate very much!
    Thank you all in advance,
    CaioToOn!

    ejp wrote:
    Thank you for the answer, but no. The path is correct.That's not what he meant. Zip file/directory entries are supposed to use / as the path separator. It is possible to use \ but such Zip files will only work under Windows. You may have erred here.Ohhh, I had really missunderstood what Ray said. But, I still think that this is not the problem, since the ZIP is a single SWF file generated by Flex SDK 3.4 and compressed in the ZLIB open standard (as in page 13, at [http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf|http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf] ). This is how Flash Compiler compress the files.
    jschell wrote:
    If the above suggestions do not solve the problem...Specify in detail with the exact steps used how you determined that it was corrupted.The reason why I believe the SWF is getting corrupted is that when it is loaded by Flash Player (in the client-side) the Player throws a VerifyError: Error # 1033. The [documentation says (see error 1033)|http://help.adobe.com/en_US/AS3LCR/Flash_10.0/runtimeErrors.html] that this error means that the SWF file is corrupted.
    As I said, what intrigues me is that this work perfectly in a Windows Server 2008 server. I just had setup a CentOS server and deployed the application. The client-remains unchanged, so why could the result change?
    raychen wrote:
    I would remove the side effect you are doing and send the file straight through, with decompress and compress, the servlet. It is more likely that you have a bug in your swf processor than the zip library.
    I had already tried it when first coding, in Windows Server 2008, it had not worked.
    Thank you all for the help.
    CaioToOn!

  • HELP?! a class that implements .....  : java.util.Vector

    My instructions say this:
    In the constructor, create the collection object (Since java.util.List is an interface, you will need to instantiate a class that implements this interface: java.util.Vector or java.util.LinkedList or java.util.ArrayList).
    I know, this IS a homework assignment - I am not sure how to go about this. I DO have code so far up to this point, can anyone help?
    import dLibrary.*;
    import java.awt.Color;
    * @author Rob
    * @version 8/18/03
    public class PhrasesII extends A3ButtonHandler
            private A3ButtonWindow win;
            private ATextField stringAcceptor;
            private ALabel listOstrings;
            private ALabel inputString;
            private ALabel status;
            private java.awt.List display;
            private java.util.List collection;
    public PhrasesII()
            win = new A3ButtonWindow(this);
            stringAcceptor= new ATextField (50,420,200,25);
            stringAcceptor.place(win);
            listOstrings = new ALabel(100, 10, 100, 380);
            listOstrings.setFontSize(10);
            listOstrings.setText("List of Strings:");
            listOstrings.place(win);
            inputString = new ALabel(50,400,200,25);
            inputString.setFontSize(10);
            inputString.setText("Input String:");
            inputString.place(win);
            display = new java.awt.List();
            display.setLocation(200, 100);
            display.setSize(200, 250);
            display.setBackground(Color.lightGray);
            win.add(display, 0);
            win.setLeftText("Save");
            win.setMidText("Display");
            win.setRightText("Discard");
            win.repaint();
      public void leftAction()
        public void midAction()
        public void rightAction()

    I am getting a " can't resolve symbol" when I do thisYou have to either import java.util.ArrayList or specify it fully, e.g., "new java.util.ArrayList()".
    Is that the line that is causing you problems? The error message should give the line number.
    my instructions also say I have to use "interface
    java.util.List when declaring your reference" so I am
    confused about using "= new ArrayList();"What they're saying is that you want code like this:
    private java.util.List frogs;    // this is the reference declaration
    //... later on...
    frogs = new java.util.ArrayList();  // this isn't a declarationWhat this means is that when you declare a field or variable, you should declare its type to be an interface.
    But when you actually instantiate a value for that variable, then you should use a concrete class that implements that interface. (You have to; interfaces can't be instantiated.)
    This is good programming style for reasons I don't have the space to explain here.

Maybe you are looking for

  • Edit mode in a table view with value node

    Hi experts. I'm trying to create a table view. This table is based on a structure that is filled with data with a RFC function module retrivening the data from another system. The problem is that i'm unable to set it editable. There is for exemple a

  • Replacing the DVD/CD-RW drive on my Satellite Pro A40

    Hi there Does anyone know if a Toshiba DVD/CD-RW drive with the model number SD-R2412 will be compatible with my Satellite Pro A40? If not does anyone know where i could find out? Some muggins broke the CD drive on my laptop by knocking the case off

  • CORBA COMM FAILURE AND ORB

    We are currently experiencing numerious and periodic CORBA COMM FAILUREs in prd. We are utilizing JDK 1.3 / CORBA and trying to submit to a C++ server object. When the web server starts up, it initializes the ORB using the ior and orb.init(). When th

  • Sales Order Open Quantity

    Hello Folks, I am trying to calculate the open sales order quantity for a particular material and plant combination. Can you please provide me with the table and field where the open sales order quantity is stored. If it is a manual calculation, can

  • Making a "search" box...

    Okay, let's say I have an XML file like this: <?xml version="1.0" encoding="iso-8859-1"?> <pages> <page url="01.swf" search="one" /> <page url="02.swf" search="two,2" /> <page url="03.swf" search="three,3,tres" /> </pages> Then, in Flash, I have load