java - How to access static variable of another program -
i want make 2 programs. program 1 have static collection , getter/setter access/update values.
i want program 2 should able access/call getter/setter of program1. static collection can shared among many programs/process
*i dont want engage port.
you can't declare variable static (or super-static) , expect available in code outside of program - doesn't work way. need sort of inter-process communication, , possibilities endless. name few: - serialize / deserialize , file (local or on network) - sockets (basically, open network connection between 2 ports on localhost) - database - shared memory (whether possible depends on os) os of choice may offer other means, principle remains same: whenever variable changes, 1 application needs notify other.
Comments
Post a Comment