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: Simple array code

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    11
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Simple array code

    Whats wrong with this code and cant print to me an array with this numbers? { 0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75 }.
    i tried many things but nothing worked lol. i tried to do it with different methods cause i know that void doesnt return value.. but nothin!

    public class Test {

    public static void main(String[] args) {

    public static void MakeArray(){
    double a[] = new a[];
    for(i = 0; i<8; i=i+1){
    a[i]=i/4;
    }
    return a;
    }
    System.out.println(a);
    }
    }

    --- Update ---

    solved lock it


  2. #2
    Member Zyrion's Avatar
    Join Date
    Feb 2013
    Location
    Iowa
    Posts
    106
    My Mood
    Angelic
    Thanks
    2
    Thanked 8 Times in 8 Posts

    Default Re: Simple array code

    Wrap your code in code tags for readability.

    [C0DE=java]
    my code
    [/CODE]

    What is not working precisely? Paste what errors you are getting from your compiler.

    UPDATE

    I see your update Go to the top of your thread and go to the drop-down menu called 'Thread tools' and choose 'Solved'.

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

    azizmaiden (March 3rd, 2013)

Similar Threads

  1. [SOLVED] Array (simple).
    By 18107 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 25th, 2012, 04:59 PM
  2. Replies: 4
    Last Post: November 14th, 2011, 09:00 PM
  3. Error for a simple array
    By DudeJericho in forum Collections and Generics
    Replies: 4
    Last Post: April 25th, 2011, 02:46 PM
  4. Need help with simple code
    By suxen in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 21st, 2011, 07:10 PM
  5. Simple code error
    By robin28 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 7th, 2010, 02:25 PM