Results 1 to 3 of 3
  1. #1
    Exceedinglife is offline Member
    Join Date
    Apr 2012
    Posts
    17
    Rep Power
    0

    Default will this copy an array?

    private void gradeExam()
    {
    /* Missing code starts here */
    char[] correct = { 'B', 'D', 'A', 'A',
    'C', 'A', 'B', 'A',
    'C', 'D', 'B', 'C',
    'D', 'A', 'D', 'C',
    'C', 'B', 'D', 'A' };
    char[] student = new char[20];
    for(int i=0; i<correct.length; i++)
    student[i] = correct[i];
    /* Missing code ends here */
    makeMissedArray();
    }



    im trying to copy 2 arrays and compare the contents then say how many are right and wrong and which ones are right and wrong

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    6

    Default Re: will this copy an array?

    In the case of char (primitive data types) - yes.

  3. #3
    Exceedinglife is offline Member
    Join Date
    Apr 2012
    Posts
    17
    Rep Power
    0

    Default Re: will this copy an array?

    Quote Originally Posted by eRaaaa View Post
    In the case of char (primitive data types) - yes.
    ok thank you i am a noob at programming and im trying to teach myself alot but im getting confused on what to do with methods im not sure if my last method is finished or if i need more to it

Similar Threads

  1. Copy of array - difference
    By diamonddragon in forum New To Java
    Replies: 3
    Last Post: 01-29-2012, 09:15 PM
  2. array copy in class constructor.
    By Juukamen in forum New To Java
    Replies: 2
    Last Post: 10-29-2011, 12:07 AM
  3. Array copy
    By lakshmibvaraprasad in forum New To Java
    Replies: 16
    Last Post: 07-21-2011, 09:17 PM
  4. Java Copy String to Array Urgent!
    By louboulos in forum New To Java
    Replies: 10
    Last Post: 03-13-2011, 10:08 PM
  5. Problem with array Copy
    By coco in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:46 AM

Posting Permissions

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