User Profile

Collapse

Profile Sidebar

Collapse
Lucas McCarthy
Lucas McCarthy
Last Activity: Dec 17 '10, 01:16 AM
Joined: Dec 14 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Lucas McCarthy
    replied to Some trouble with packages
    in Java
    I entered the following line:
    Code:
    C:\Java\jdk\bin\javac -classpath C:\Users\Kenny\Desktop\testpackage TestSubClass.java
    and got the same error. Do you think it might be to do with my Java installation?
    See more | Go to post

    Leave a comment:


  • Lucas McCarthy
    replied to How to fix Unreachable Statements?
    in Java
    The problem is the first break statement always terminates the while loop. Try enclosing the system.out.prin t statements and the break statements in brackets:

    Code:
     if (guess<answer)
      {
      System.out.print("The answer is higher");
      break;
      }
    That way, it's executed conditionally, along with the print statement.
    See more | Go to post

    Leave a comment:


  • Lucas McCarthy
    replied to Some trouble with packages
    in Java
    I'm not entirely sure what you mean. Sorry, Java is a bit difficult for me to understand.
    See more | Go to post

    Leave a comment:


  • Lucas McCarthy
    replied to Some trouble with packages
    in Java
    I should think so. I unset the classpath then set it to the folder.

    Code:
    set CLASSPATH=
    set CLASSPATH=C:\Users\Kenny\Desktop\testpackage
    See more | Go to post

    Leave a comment:


  • Lucas McCarthy
    started a topic Some trouble with packages
    in Java

    Some trouble with packages

    I've started studying java using the tutorial on Oracle. I've been making a program as I've gone along in the tutorial, adding what I learn to the program. When I reached the packages section, I tried packaging my program. However, after I set up the package, my files couldn't find each other. After a couple frustrating hours of trying to fix it, I made a simple package with the following files:

    C:\Users\Kenny\ Desktop\testpac kage\TestSuperC lass.java:...
    See more | Go to post
No activity results to display
Show More
Working...