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: Java-gaming.org trivia question!!! HELP!

  1. #1
    Junior Member
    Join Date
    Jul 2017
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Java-gaming.org trivia question!!! HELP!

    I tried to register to their forum im trying to learn java. so i try to run the following code

    public class Main {
     
        public static void main(String[] args) {
     
            int i = 2;
            int d = "WLM".hashCode() % 3000;
            int e = "KLR".hashCode() % 3000;
            for (int v = 0; v <= e; v++)
                i = (i ^ v) % d;
            return i;
     
        }
    }

    What year was einstein dead?: 1955
    What is the returned value?
    What is the greatest common divisor of the previous two numbers?

    but errors says: Error10, 16) java: incompatible types: unexpected return value im using IntelliJ IDEA
    Last edited by Norm; July 2nd, 2017 at 05:25 AM. Reason: Changed B tag to code tag

  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: Java-gaming.org trivia question!!! HELP!

    unexpected return value
    The method is defined as void so it should not return a value.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Java Gaming Talk
    By fatchance30 in forum The Cafe
    Replies: 1
    Last Post: April 6th, 2014, 03:42 AM
  2. Gaming code
    By drumrboy13 in forum The Cafe
    Replies: 1
    Last Post: March 1st, 2013, 01:57 AM
  3. Gaming code
    By drumrboy13 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 25th, 2013, 05:56 PM
  4. Gaming Programmer or other needed for company success
    By pachelabaro in forum Paid Java Projects
    Replies: 1
    Last Post: June 16th, 2011, 08:29 AM
  5. Final Project - Trivia Game
    By Goforit in forum Java Theory & Questions
    Replies: 5
    Last Post: May 14th, 2011, 05:56 AM

Tags for this Thread