Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: A few questions about a line of code regarding an array.

  1. #1
    Junior Member
    Join Date
    Dec 2021
    Posts
    26
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Default A few questions about a line of code regarding an array.

    What does [i++] do?
    What does (int) do?

     sum[i++] = (int)((num1 % 10 + num2 % 10 + rem) % 2);

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: A few questions about a line of code regarding an array.

    What does [i++] do?
    Indexes the array at location in i and then increments the value in i
    What does (int) do?
    Casts the value to its right as int
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    FightingIrishman (December 31st, 2021)

Similar Threads

  1. array searching the location in one line
    By sumon_bd in forum What's Wrong With My Code?
    Replies: 5
    Last Post: December 26th, 2021, 07:22 AM
  2. Several questions about my code
    By ProgrammerNoobE in forum What's Wrong With My Code?
    Replies: 4
    Last Post: May 23rd, 2013, 03:57 PM
  3. Replies: 10
    Last Post: September 16th, 2011, 07:49 PM
  4. [SOLVED] Accessing && Editing properties of objects in an array. Plus a few more questions.
    By CameronFaust in forum Collections and Generics
    Replies: 31
    Last Post: August 10th, 2011, 07:35 PM
  5. 2 questions(an error and line breakpoint?)
    By derekxec in forum What's Wrong With My Code?
    Replies: 13
    Last Post: July 22nd, 2011, 06:14 PM