Search:

Type: Posts; User: IanSawyer

Search: Search took 0.09 seconds.

  1. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    Thanks for the advice guys.

    I've amended my code so that values that will be used by multiple methods are class variables and any other variable is local to a particular method.
  2. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    I've fixed it!

    A couple of lines of code needed rearranging between methods!

    Thanks for your help, I'm sure that I wasn't entirely clear with my problems!
  3. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    The data that the program uses is input by the user through a command prompt window. The correct values of year, month and day are being printed.

    I have also now narrowed down the issue being...
  4. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    Even with hardcoded values, 0 is returned for lastDayOfMonth.

    I rewrote part of the code just for testing and put it into a single class and it all works fine. lastDayOfMonth returns the correct...
  5. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    Main class


    import java.util.*;
    import java.text.*;
    import javax.swing.*;

    public class MainClass {
    public static void main(String[]args){
  6. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    I have narrowed down the problem to the lastDayOfMonth = date.getActualMaximum(GregorianCalendar.DAY_OF_MONTH); line.

    For some reason that line returns 0 for any form of date when ran in the...
  7. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    Sorry I don't understand where I am supposed to add the println statements.

    And how would the discount=true; executed?
  8. Replies
    20
    Views
    1,845

    [SOLVED] Re: Can't reassign boolean value!

    The boolean isn't being set as true which is the issue.

    Any dates that I input which should meet the criteria of the if statement don't set the boolean to true. It stays false.
  9. Replies
    20
    Views
    1,845

    [SOLVED] Can't reassign boolean value!

    Hi guys,

    I am having an issue with some Java that I have written.

    I have a class called Journey and within this class I have some methods. In my code I have a boolean data member set as false...
Results 1 to 9 of 9