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 3 of 3

Thread: Java with NetBeans 8.0 easy question

  1. #1
    Junior Member
    Join Date
    Oct 2014
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Java with NetBeans 8.0 easy question

    Here is the problem and I know i'm super megaNoviceSuperNewbTrollMeHard


    but for my class I have a lot of peer grading assignments and whenever i get classmates' .java files...i open file and it shows the contents but I cannot run it for the life of me....I end up looking at their code and guessing the outcome compared to the solution...and their posted answers....which would be doing a disservice to my instructor...was wondering if anybody knows how to run a .java file that you did not create.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Java with NetBeans 8.0 easy question

    Pretend you did create it . . .

    Create an appropriately named class in Netbeans, paste the .java file you've been given into that class, preserving the package name (if applicable), compile, and run. If you don't want to create multiple classes, one for every peer file you've been given, create one class for testing, post the peer code into it, and rename their class to match the name of the class you created. I use the latter method for testing code I see here.

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

    cosmicvista (October 9th, 2014)

  4. #3
    Junior Member
    Join Date
    Oct 2014
    Posts
    8
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Java with NetBeans 8.0 easy question

    Thank you sir GregBrannon.

Similar Threads

  1. [SOLVED] easy question for a pro
    By meangreen2003 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 16th, 2014, 08:20 PM
  2. Very easy question about output.
    By ma5sacre in forum What's Wrong With My Code?
    Replies: 3
    Last Post: January 11th, 2014, 10:12 AM
  3. An easy question
    By KAJLogic in forum Java Theory & Questions
    Replies: 5
    Last Post: December 1st, 2013, 04:55 AM
  4. Easy array question
    By surfbumb in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 3rd, 2011, 09:44 PM
  5. Quick easy Java question.
    By DHG in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 25th, 2011, 03:59 PM