Results 1 to 7 of 7

Thread: Does Java support copy constructor?

  1. #1

    Default Does Java support copy constructor?

    Hey guy's tell me Does Java support copy constructor?

  2. #2

    Default

    No. Java does not support copy constructor.

  3. #3

    Default

    No, Java does not support copy constructor. The copy constructor is one type of the constructor which works for copy of any existing object. This can supports in C++ programming language but not into JAVA programming. So, Java can not support Copy Constructor.
    Last edited by brainusa; 10-09-12 at 02:09 PM.


  4. #4

    Default

    There is such a thing as a copy constructor in Java, but it
    does not play the special role that such constructors do in
    C++. A copy constructor in Java is just like any other
    constructor: you call it with new.

    public class A {
    private int x;

    public A(int x) { this.x = v; }
    public A(A that) { this.x = that.x; }
    }

    ...
    A a1 = new A(5);
    A a2;
    a2 = new A(a1);
    ...

    There are no assignment constructors, or anything much
    like them, in Java. That is because Java does not
    have operator overloading. The assignment operation
    (=) is always a shallow assignment, or scalar assignment
    if you prefer, and you NEVER have to doubt that. I've
    gotten in plenty of trouble with C++ code that used fancy
    copy constructors and overloaded assignment operators!

    Java does have the notion of a clone (copy) method. Any
    object can support the clone() method; by convention the
    method implementation is supposed to perform a deep copy
    of the object on which it is called, and return the copy.
    Of course, there are difficulties with that, too.

  5. #5

    Default

    According to me java doesn't support copy constructor. The copy constructor is an integral part of C++, since it instantly makes a regional copy of an item. It performs excellent in C++.

  6. #6

    Default

    Among its multiple functions are 'Deep Care' and 'Quick Care'. Deep Care is a thorough inspection and repair of PC problems that include Full Malware Removal, Deep Registry Fix, Registry Defrag, System Optimization, Startup Optimization, Shortcut Fix, Privacy Sweep, Junk Files Clean, Security Defense, Vulnerability Fix and Disk Defragment, while 'Quick Care' is a less intense inspection of PC problems.

    Apart from these functions you have a Toolbox that is really a box of treasures. It has lots of supporting utility software and functions as well to help in performing several tasks. The supporting software present in toolbox are IObit Uninstaller, File Shredder, Smart RAM, Smart Defrag. The software Registry Cleaner, Internet Booster, Registry Defrag is available with the Pro version

  7. #7
    Enthusiast
    Join Date
    Aug 2017
    Location
    Chennai
    Posts
    30

    Default

    No, Java does not support copy constructors.

Similar Threads

  1. Free Copy of Which Right Choice magazine
    By pratikg88 in forum Your Voice / Community Center
    Replies: 3
    Last Post: 01-08-10, 01:21 PM
  2. Is London Dreams a copy?
    By bharath2080 in forum Bollywood Movies
    Replies: 1
    Last Post: 01-09-09, 04:54 PM
  3. Now a bollywood copy in hollywood
    By aks21 in forum Bollywood Movies
    Replies: 11
    Last Post: 08-04-09, 06:21 PM
  4. Replies: 1
    Last Post: 05-04-09, 01:18 AM
  5. Replies: 0
    Last Post: 13-12-08, 12:40 PM

Share this page with your friends

Share this page with your friends

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •