In the future, when posting code, please UseCodeTags(←click) and use proper indentation. I've fixed it for you this time. See how much more readable it is?
As for your problem:
when the accessMethod value is 0 - interMode is assiging as 4050005
when the accessMethod values is 1 - interMode is assigning as 4050002
No, it's not. I 100% guarantee you it's not. Not with that code. Either you're running different code (maybe old code with reversed logic, and you didn't recompile), or else you're misinterpreting what you're seeing. Java code doesn't just behave randomly, and if something that simple and fundamental were broken, people would be screaming up and down about it and nothing would work.
You need to check your assumptions more carefully, and if you can't figure it out, you'll have to post more details here about what you're actually doing and how you're observing the code's behavior so that somebody here can point you in the right direction.
If you're observing the problem intermittently, it is almost certainly a multithreading problem. You're probably not using proper synchronization somewhere.
I once worked in a programming environment where parameters were passed by reference, and constants were not kept track off.
That is, you were able to pass a literal constant value to a function which then changed it!
From that moment on, all references to that literal constant were referring to a different value: they got broken.
Probably you are doing some basic mistake. Take a deeper look at your code. The data that you have provided is insufficient (i.e. what is accessMethod etc.) sharing your entire class with us might help.
If you REALLY think your code is doing that, prove it to yourself. System.out.println can be your best friend. When things are happening that just don't make any sense, I will stick dozens of S.o.p statements in. print the value of accessMethod just before your switch statement. inside each case, print "I am in case 0" (or whichever case you are really in). Print out a line like "I am assigning the value of 4050002 to intermode" just before you do the assignment, then print "i just assigned the value of 4050002 to intermode just after you assign it.
just after you close your switch statement, print the value of intermode again, before ANY other line of code runs.
My guess is that either a) accessMethod isn't what you think it is, b) you are missing break statements somewhere, or c) intermode is being set to something in another spot.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
subject: randomly assigning the wrong values into a variable in switch case