DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Hybrid View

  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




Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links