Questions on JAVA


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Questions on JAVA

  1. #1
    Ravi Guest

    Questions on JAVA


    Dear Colleagues,

    I have a few questions on JAVA, which I would be MOST grateful if any of
    you could answer. Specifically, these concern moving C/C++ code to JAVA.


    1. What are the JAVA equivalents of C++ language's:

    a. virtual/pure virtual functions.

    b. default argument functions,

    c. Formatted I/O, eg. {printf ("%40", ix)
    Cout<<manipulators<<ix}

    d. copy constructors,

    e. sizeof() --- I do not detect a sizeof)) in JAVA !. Is there any reason
    for this ?.

    Could you please also provide a simple example concerning the migration !.

    2. What is a "javap" class file disassembler ?.
    3. What is the JAVA equivalent of "closer()" ?

    Many thanks for your time and patience, and I look foprward to hearing from
    you in the near future.

    Sincerely yours

    Ravi Venkatesan

  2. #2
    Paul Clapham Guest

    Re: Questions on JAVA

    a. All Java methods are virtual.

    b. Here's an example of how you do default arguments:

    public void update(int x) {
    // do something using x here...
    }
    public void update() {
    this.update(0); // default value is zero
    }

    e. Java doesn't have sizeof() because it's none of your business. (I.e.
    there's no way for you to use this information in Java.)

    Ravi <r_c_v@vsnl.com> wrote in message news:38d4f0a4$1@news.devx.com...
    >
    > Dear Colleagues,
    >
    > I have a few questions on JAVA, which I would be MOST grateful if any of
    > you could answer. Specifically, these concern moving C/C++ code to JAVA.
    >
    >
    > 1. What are the JAVA equivalents of C++ language's:
    >
    > a. virtual/pure virtual functions.
    >
    > b. default argument functions,
    >
    > c. Formatted I/O, eg. {printf ("%40", ix)
    > Cout<<manipulators<<ix}
    >
    > d. copy constructors,
    >
    > e. sizeof() --- I do not detect a sizeof)) in JAVA !. Is there any

    reason
    > for this ?.
    >
    > Could you please also provide a simple example concerning the migration !.
    >
    > 2. What is a "javap" class file disassembler ?.
    > 3. What is the JAVA equivalent of "closer()" ?
    >
    > Many thanks for your time and patience, and I look foprward to hearing

    from
    > you in the near future.
    >
    > Sincerely yours
    >
    > Ravi Venkatesan




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center