Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7617435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:08:59+00:00 2026-05-31T03:08:59+00:00

I compiled two java source codes, namely version.class and open.class Basically, the version.class holds

  • 0

I compiled two java source codes, namely version.class and open.class

Basically, the version.class holds the public static void main clause, while the open.class is mainly a set of constructors that makes the whole program work.

Here is how I did it:

if ("n".equalsIgnoreCase(input)) {
    new open();
} else if ("q".equalsIgnoreCase(input)) {
        System.exit(0);
    }

The problem is when I run it in CMD, where I did type this:

java version

it says that the command can not find or load the main class. What is the main problem why this happens? Thank you. I was hoping this would run in CMD as well when compiled, so I could make a bat file to make the program run in CMD as well.
Edit:

Here is the whole version class:

import java.util.Scanner;
public class version{
public static String input;
public static Scanner s = new Scanner (System.in);

public static void main (String [] args ) {
    System.out.println("========================");
    System.out.println("ANAGRAM MASTER VERSION 1.0");
    System.out.println("Created by: Janrae Mendoza");
    System.out.println("==========================");
    System.out.println("Press the corresponding letters for your desired option: ");
    System.out.println("<n> New Game");
    System.out.println("<q> Quit Game");
    input = s.nextLine();

if ("n".equalsIgnoreCase(input)) {
    new open();
} else if ("q".equalsIgnoreCase(input)) {
        System.exit(0);
    }
    }

}

while this is the open class:

import java.util.Random;
import java.util.Scanner;


public class open{

public String input;
public Scanner s = new Scanner (System.in);
public Random r = new Random();

//at least 25 words
public String scrambled[] = {"MICSECO", "LEPAIM", "ICHORE", "MLORTA", "TIEEXSUQI",
        "MEERTO", "DESTOAK", "MLIBOE", "PHRAPARGA", "UALBILNGI", "DOXORTHRO",
        "ZEIMESREM", "OKVEPRO", "ILAPRS", "TEMOED", "QUEMSADRAE", "LSEIMUP",
        "CREUPRO", "BLRUNDE", "CKRENO", "UIPRSUT", "BINMEHLOGO", "DRKERA",
        "SEACEDAP", "SOULEAZ"};

public String scrAns[] = {"ECONOMICS", "IMPALE", "HEROIC", "MORTAL", "EXQUISITE",
        "REMOTE", "STOCKADE", "MOBILE", "PARAGRAPH", "BILINGUAL", "ORTHRODOX",
        "MESMERIZE", "PROVOKE", "SPIRAL", "DEMOTE", "MASQUERADE", "IMPULSE",
        "PROCIRE", "BLUNDER", "RECKON", "PURSUIT", "HEMOGLOBIN", "DARKER",
        "ESCAPADE", "ZEALOUS"};

public int word;
public boolean stop = false;
public int scrnum;
public int timesplayed;

public void sleep() {
    try {
        Thread.sleep(1000);
    } catch (Exception e) {}
}

public open() {
        while (stop == false) {
            sleep();
    System.out.println("Guess out the scrambled word!");
    word = r.nextInt(24);
    scrnum = word;
    System.out.println("ANAGRAM: " + scrambled[word]);
    System.out.print("YOUR ANSWER: ");
    input = s.nextLine();
        if (input.equalsIgnoreCase(scrAns[scrnum])) {
            System.out.println("You guessed the word right!");
            System.out.println("Continue playing? <y> Yes and any other keys for No");
            input = s.nextLine();
                if ("y".equalsIgnoreCase(input)) {
                    timesplayed++;
                } else {
                                        stop = true;
                                    }
        }

        }
        System.out.println("Thank you for trying out version 1 of this game! You played " + timesplayed
                + " times! Enjoy your day, player!");
}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T03:09:00+00:00Added an answer on May 31, 2026 at 3:09 am

    As per your question , I can see that you have created two classes and they are

    1. version.class
    2. open.class

    where from you are getting “titleScreen” class ?

    You have main method only in version.class .
    So , the main() method of the version.class can only be the entry point .

    You can run the program in like the following :

    java version titleScreen

    titleScreen can be the input of this program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes: MyApplication Library The Library has already been compiled into Library.class
I'm trying to compile a java source file that uses two jar files (trove
I have two Java class files: primegen and primecheck sitting in the same directory.
I am trying to compile two java programs in Eclipse on Ubuntu. I then
two questions: how do i compile a .java file that isn't on my username
the following piece of C++ code compiled two years ago in a suse 10.1
I have two DLLs compiled separately, one is compiled from Visual Studio 2008 and
The code below compiled in Debug configuration in VS2005 SP1 shows two messages with
I've compiled the RibbonLib, then I got two DLLs( Microsoft.WindowsAPICodePack.dll and Ribbon.dll ), but
How .aspx and aspx.cs file is being compiled? will it be two assemblies or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.