ByteBuffer: how come the abstract methods work?

I am confused about the abstract methods in ByteBuffer class. Many of the methods in that class are declared abstract but yet I am able to use them without a problem.
For example, put(byte b) is declared abstract in the java docs. But I am able to use that method ( I did not have to extend ByteBuffer and implement this method). I know I must be missing something here...any help would be appreciated.
thanks

Those responses should certainly do the trick. But I love hearing myself type, so here's an example:abstract class Fred
     public abstract void hiThere();
class SubFred extends Fred
     public void hiThere() { println("Greetings Professor Falken"); }
}Somewhere some method says it returns an object of type Fred. To do this they might (as far as you know) create an instance of SubFred and return that to you. SubFred is of type Fred. Your code doesn't know or care (usually) what the ACTUAL class is, as long as it matches what you expect Fred to be from the documentation.

Similar Messages

  • HT4914 How does the payment method work for iTunes Match?

    How does the payment method work with iTunes Match. For example, if you have a gift card, does it take it out of that. Or is there tax? What if you cancel your subscription in the middle of the year, does it take the money for that year or not? If someone could answer those questions it would be greatly apreciated. And if anyone has their own questions, feel free to ask. Thank you.

    Hi HLFrank,
    Welcome to Adobe Forum,
    You can opt for monthly payment in a yearly contract or pay at one go for an year.
    Please check the option at http://www.adobe.com/in/products/creativecloud/buying-guide.html
    Regards,
    Rajshree

  • How does the .accept() method work?

    Hi,
    I have checked the source code of the ServerSocket implementation that comes with the jdk.
    I tought I was going to find some type of loop. However I found nothing like that! so how does the accept method work.
    I mean when we call the .accept() method, the thread in which the socketServer is initialized gets stoped untill a new client connection is recieved! how is this actually managed?
    Regards,
    Sim085

    At a guess, the accept call that Java makes, relies on the OS system call through JNI. accept would then block until a new connection is present if you are using blocking.

  • How does the return method work?

    how does the return method work?

    What do you mean by "return method"? Methods return a value (or void, but that's still a "value" of sorts).
    Returning a Value from a Method
    http://java.sun.com/docs/books/tutorial/java/javaOO/methoddecl.html

  • How does the abstract method do its job?

    //SSLSocketFactory factory =
              (SSLSocketFactory)SSLSocketFactory.getDefault();
    //SSLSocket socket =
              (SSLSocket)factory.createSocket("www.verisign.com", 443);
    The method 'createSocket(String host, int port)' is an abstract method, I'm confused that how this method did created a socket with an empty implementation?
    Can you help?

    //SSLSocketFactory factory =
    (SSLSocketFactory)SSLSocketFactory.getDefault();
    //SSLSocket socket =
    (SSLSocket)factory.createSocket("www.verisign.com", 443);
    The method 'createSocket(String host, int port)' is an abstract method, I'm confused that how this method did created a socket with an empty implementation?
    Can you help?
    The SSLSocketFactory's getDefault() method has an implentation that will return a class of type SSLSocketFactory. Example (this may not be the code but it's close):
    public abstract class SSLSocketFactory ... {
       ... // other methods
       public SSLSocketFactory getDefault(){
          return new SSLSocketFactoryImpl();
       private class SSLSocketFactoryImpl extends SSLSocketFactory {
          // concrete implementation of methods...
          public SSLSocket createSocket(..., ..., ....){
             return new SSLSocketImpl(..., ..., ...);
          private class SSLSocketImpl extends SSLSocket {
             SSLSocketImpl(..., ..., ...){
             // concrete implementation of methods...
    }As you can see here it is not really the SSLSocketFactory and SSLSocket that you are getting. You are getting concrete implementations of this class.
    To prove to you, change your code to this:
    //SSLSocketFactory factory =
    (SSLSocketFactory)SSLSocketFactory.getDefault();
    //SSLSocket socket = (SSLSocket)factory.createSocket("www.verisign.com", 443);
    System.out.prinntln(factory.getClass().getName());
    System.out.prinntln(socket.getClass().getName());This will show you the actual name of the classes.

  • How does the substring method work

    hey folks, does anyone know how the substring method works

    Then you want to use String.split using regular expressions:
    split
    public String[] split(String regex)
        Splits this string around matches of the given regular expression.
        This method works as if by invoking the two-argument split method with the
    given expression and a limit argument of zero. Trailing empty strings are
    therefore not included in the resulting array.
        The string "boo:and:foo", for example, yields the following results with these
    expressions:
            Regex      Result
            :      { "boo", "and", "foo" }
            o      { "b", "", ":and:f" }
        Parameters:
            regex - the delimiting regular expression
        Returns:
            the array of strings computed by splitting this string around matches of
    the given regular expression
        Throws:
            PatternSyntaxException - if the regular expression's syntax is invalid
        Since:
            1.4
        See Also:
            Patternhttp://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#split(java.lang.String)
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html#sum
    Have fun,
    JJ 

  • How come the current view button does not work?

    How come the current view button does not work?

    Sorry, I have no idea what you are asking; please provide some details, and/or a screenshot if possible: https://forums.adobe.com/thread/1070933

  • How to find the abstract method?

    Hello all,
    I have a quick question.
    If there is an abstract class with few abstract methods in it, how can we know which one is abstract method in SE24 ?
    Is there any setting to display all the abstract methods in SE24?
    And, all the methods are getting displayed in SE24 in such a way that
    <Interface1>
         method1
         method2
    <Interface2>
         method1
         method2
    Is it possible to display only the methods without its interface name?
    Thank you.
    -Ezhno.

    Hi Ezhno,
    In methods tab of se24, select the method &
    Click on detail view icon i.e. 4th button after Parameter, Exception & code button, there you can see attributes of method , there is a checkbox for 'Abstract'.
    Thanks,
    Sharath

  • How to declare abstract method

    given - work worked at first .
    fact - then i went to add new entity object names ScottOafE0 . went through all the next sand finished. a package and entity obj already exist. i also tried to put a new package and ScottOafAM in a seperate place. still a no go
    when i went to run the form it errors out w/ below msg.
    Error(14,8): class xxxoaf.oracle.apps.xxuab.hr.newforms.server.ScottOafEOImpl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) in class oracle.apps.fnd.framework.server.OAEntityImpl
    Guess - i tired to put import oracle.apps.fnd.framework.server.OAEntityImpl in the controller file . didnt work
    any idea how to define abstract method ?
    thanks
    scott

    You dont need to define your class as abstract, that would not resolve your issue, what is happening is
    oracle.apps.fnd.framework.server.OAEntityImpl is a abstract class, and has a method declared as setLastUpdateLogin(oracle.jbo.domain.Number) in class
    Now, any class (xxxoaf.oracle.apps.xxuab.hr.newforms.server.ScottOafEOImpl ) extending from this class must either provide a definition to this method (provide the implementation logic), or must itself be declared abstract.
    We had a discussion on this issue in the forum , look for the thread.
    Thanks
    Tapash

  • How does the Passbook application work? How am I able to import my plane ticket, concert ticket etc into Passbook?

    How does the Passbook application work? How am I able to import my plane ticket, concert ticket etc into Passbook?

    Try the following to fix the iTunes Can't Connect issue that you are having:
    Open Settings.
    Open General.
    Open Date & Time.
    Switch the Set Automatically setting to Off.
    Open Set Date & Time.
    Set the date to a year ahead.
    Go back to the Home screen and open Passbook.
    Tap the App Store button. The App Store should load.
    Go back to Date & Time and turn on Set Automatically.
    Thanks to: https://discussions.apple.com/message/19622208#19622208

  • How do the two codes work ?

    i came across the following code in socket programming in the net,could anyone please tell me that how do the following codes work together? there is no main class in ChatHandler programme but there seems that it is a separate programme.. being new to java i am unable to understand it, please someone help
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class ChatServer {
        public static final int DEFAULT_PORT = 9800;
        public static void main(String[] args) {
         int port = DEFAULT_PORT;
         ServerSocket serverSocket = null;
         Socket socket = null;
         try {
             if(args.length > 0)
                 port = Integer.parseInt(args[0]);
         } catch(NumberFormatException nfe) {
             System.err.println("Usage: java ChatServer [port]");
             System.err.println("Where options include:");
             System.err.println("\tport the port on which to listen.");
             System.exit(0);
         try {
             serverSocket = new ServerSocket(port);
             while(true) {
                 socket = serverSocket.accept();
                 ChatHandler handler = new ChatHandler(socket);
                 handler.start();
         } catch(IOException ioe) {
             ioe.printStackTrace();
         } finally {
             try {
                 serverSocket.close();
             } catch(IOException ioe) {
              ioe.printStackTrace();
    }// ChatHandler.java
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.Socket;
    import java.util.Vector;
    public class ChatHandler extends Thread {
      static Vector handlers = new Vector( 10 );
      private Socket socket;
      private BufferedReader in;
      private PrintWriter out;
        public ChatHandler(Socket socket) throws IOException {
            this.socket = socket;
         in = new BufferedReader(
             new InputStreamReader(socket.getInputStream()));
         out = new PrintWriter(
             new OutputStreamWriter(socket.getOutputStream()));
        public void run() {
            String line;
         synchronized(handlers) {
             handlers.addElement(this);
    // add() not found in Vector class
         try {
             while(!(line = in.readLine()).equalsIgnoreCase("/quit")) {
              for(int i = 0; i < handlers.size(); i++) {     
                   synchronized(handlers) {
                          ChatHandler handler =
                           (ChatHandler)handlers.elementAt(i);
                      handler.out.println(line + "\r");
                   handler.out.flush();
         } catch(IOException ioe) {
             ioe.printStackTrace();
         } finally {
             try {
              in.close();
              out.close();
              socket.close();
             } catch(IOException ioe) {
             } finally {
              synchronized(handlers) {
                  handlers.removeElement(this);
    }

    pranay09 wrote:
    ok, but when i am compiling the two codes, then for the second one i get the error that no main class found:No, you will never get that when compiling.You will get that when running, if the class you try to run is not on your classpath.
    main() is simply the entry point into your program for the JVM. When you say
    java MyClassYou're telling hte JVM to execute public static void main(String[] args) in the class MyClass. That class must be on your classpath and it must have that method. That class is then free to use any other classes, in its own package or in other packages (provided they are accessible and on the classpath), regardless of whether those classes have a main method.

  • How does the repair process work

    how does the repair process work, currently broke my iPhone, water damage, and still have a warranty until july 30.

    http://www.apple.com/support/iphone/repair/other/

  • How does the multicolumn listbox work?

    how does the multicolumn listbox work?

    Code attached
    [email protected]
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    Get_DlbClk_Row_ifk2003.vi ‏31 KB

  • How is the product allocation  work?

    How is the product allocation  works? (material master: Basic Data 1,) where is the place to maintain the parameters?
    point will given

    Product Allocation
    Configuration Overview; Allocation Specific Usage
    1.Allocation Procedure (OV1Z) The product allocation procedure is the parent of the entire allocation process. All materials that are to be included in the allocation scheme are required to have an allocation procedure assigned to it in the material master. In addition, as of release 4.0, it is in the procedure that the method of allocation is defined. The user has the opportunity to set an indicator to identify their choice of two different methods (discrete and cumulative allocation) to evaluate the quantities to be considered for product allocation.
    2.Allocation Object (OV2Z) The allocation object is the root level of the allocation process where actual data is entered and planned in LIS. The object allows the user to further break down a procedure into smaller parts for future validation of components comprising a specific material
    3.Allocation Hierarchy Mapping (OV3Z) Primarily, this transaction permits the assignment of an allocation procedure to an LIS information structure. Secondly, a character is assigned to the information structure to permit collective planning. Finally, the user can assign a step level to the procedure and information structure to sequence the order in which allocation quantities are checked. This functionality allows the user the opportunity to check product allocation against several product allocation scenarios, before the required quantity is confirmed
    4.Define Consumption Periods (OV5Z) The allocation consumption periods functionality is only valid if the allocation method flag has been set (OV1Z). If you have de-selected the method field, this functionality is not available. The consumption window indicates the number of past and future periods to be used in the allocation check.
    5.Control Product Allocation (OV4Z) In order for the allocation process to function properly, allocation control records are created primarily to map allocation procedure steps to their corresponding objects so that the allocation data records can be located for validation. Secondly, validity periods must be established to indicate when the allocation control records are active. Finally, the user has the option of establishing a conversion factor per allocation control record to accommodate BOM listings of constrained materials
    6.Activate Allocation for Requirement Class (OVZ0) In order to turn on allocation in the standard order processing functionality, the requirements class must have a flag indicating that allocation is relevant.
    7.Activate Allocation for Schedule Line Category (OVZ8) In order to turn on allocation in the standard order processing functionality, the schedule line must have a flag indicating that allocation is relevant
    8.Create Planning Hierarchy (MC61) In order to adequately establish allocation quantities, the user must initially determine the level at which the allocation is to take place and the aggregation factor of the allocation quantities. In this step, the levels for the collective allocation search procedure are also identified.
    9.Generate Masking Character (OV7Z) Upon completion of the level determination for the planning hierarchy, the collective allocation masking character must be generated to allow aggregation indicators to be established. This transaction simply reads the hierarchy established in the planning table and then generates a collective mask character for each level of the hierarchy
    10.Modify Planning Hierarchy (MC62) This step is a repeat of MC61 where the initial hierarchy was established. In order to complete the hierarchical set up, the collective allocation (mask character) hierarchy must now be maintained with the appropriate aggregation factors
    11.Allocation Procedure Assignment to Material Master (MM02) At the root level of the allocation process are the materials. Each material that is to be considered in allocation scenario must be mapped to an allocation procedure. In order entry, then, when a material is entered with a valid allocation procedure in the material master, the allocation data is verified prior to confirming the line item ordered
    12.List of Suitable Structures (OV9Z) This report is used to identify potential LIS information structures that can be used in the product allocation process. This report simply reads through the data dictionary and selects all the active information structures that contain the field product allocation object (KONOB) as the first field. This data can then be utilized in the mapping transaction (OV3Z) to link the allocation procedure step to an information structure (previous step).
    Regards
    Jitesh

  • How does the Delta functionality works while updating Infocube from PA

    Hi Gurus
    How does the Delta functionality works when you send forecast to the Info cube from the Planning Area.
    As I have weekly based planning, every week we have to update the forecast into the Cube. If I update  every week into the Cube , then the values are going to append  in the Info cube.
    Shall I create ODS in between the Planning area  and the Info cube .
    (or)
    Any other method ?
    Please Suggest.

    Hi Preetham,
    Data Extraction from planning area to infocube usually its supports for full update only, when u r going to load the data from planning area to cube ,it deletes the previous data and u vil get the fresh data, this is the best method performance wise,
    if u want to use the delta functionality u can go for planning area to Dso, Dso to cube, it vil supports the delta functionality, but it vil degrades the system performance,
    regards
    ravi

Maybe you are looking for

  • IPhone 5 getting very hot in car cradle

    I have bought a BMW cradle to charge my iphone 5 which also boosts the signal. It is an authentic BMW/Apple part. The iphone gets very hot even on short journeys. Is this normal?

  • Xsl sum question

    hi all, I'm trying to find the sum of a specific set of nodes and my sum statement looks like this: <xsl:value-of select="sum(//row[*[name=$sortDefault]/month=$currentMonth]/obligation)"/> This will sum up all the obligation nodes of all the rows tha

  • Adobe Media Encoder All Video Output 'White'

    Hi all, I am attempting to use Adobe Media Encoder to  export a QT h264 optimized for upload to facebook from a QT file exported 'Same as Source' from Avid MC 5.0.3, whic would be 1080i60 1920x1080.  The source file playsback correctly in QT player o

  • Lumia 1020 restarts automatically

    Hi, I have purchased the lumia 1020 a month ao and I find the following problems. 1) The phone restarts automatically about 15 times a day/ 2) when running apps such as nokia cam or Here drive, the phone freezes. I have to wait for the battery to dra

  • Managing Time Machine Disk Space

    I have a NAS server that I use to back up all my computers (3 PCs, and 2 Macs).  For various reasons that I won't bore you with, I cannot partition that storage into multiple partitions.  Is there a way to control how much disk Time Machine uses befo