Skip to content

Caching java instance for peformance

Please assist, What is meant by caching this line/new instance in java for example: I know I have to store insome sort of memory… may someone show me an example. Thanks. Answer Caching means don’t let the garbage collector trashing your variable after you use it, if you already know that you will …

How to close program if text document is not found

This is the top of my program. You are to type in a .txt file name for it to open. Problem: How do I have the program display an error message and close the program if .txt file is not found? Answer You can put File in try catch block like this and show a relevant message:

Output file contains wrong data [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year. Improve this question I have a program that is to ask the user their name (this will be used as th…

print a jagged array from a file

i am trying to print a jagged array just like my txt file is. I have already found the rows I was told to create a 2d array now with just the rows since we don’t know the columns yet and then find the doubles there are in the file. Answer There are three main issues, firstly all the column