I am currently struggling with memory handling. I have an if statement and each case instantiate a new object from a class. Does this affect the memory allocation in java?switch(){case 1:test t1 = new test();case 2:test t2 = new test();case 3:test t3 = new test();case 4:test t4 = new test();case 5:test t5 = new test();case 6:test t6 = new test();}
Multiple Instantiate of 1 class affects memory?
java;memory;garbage collection;memory usage