What is the home directory for JDK?

I am having a problem in selecting home directory for JDK. Even though I have selected the following path: “C:\Program Files (x86)\Java\jre1.8.0_91”, it keeps showing the error: “The selected directory is not a valid home for JDK”. My java folder has two folders- bin and lib. Window for selecting home directory Kindly help me in … Read more

What is the purpose of creating static object in Java?

The static keyword in Java means that the variable or function is shared between all instances of that class, not the actual objects themselves. In your case, you try to access a resource in a static method, Thus anything we access here without creating an instance of the class Flavor1Demo has to be a static … Read more

When should you use multithreading? And would multi threading be beneficial if the different threads execute mutually independent tasks?

Q: When should you use multithreading? A: “Your question is very broad. There are few non-trivial systems where the functionality can be met simply, quickly and reliably with only one thread. For example: [pick out a typical system that the target company sells and pick out a couple aspects of its function that would be … Read more

How to cast ArrayList<> from List<>

When you do the second one, you’re making a new arraylist, you’re not trying to pretend the other list is an arraylist. I mean, what if the original list is implemented as a linkedlist, or some custom list? You won’t know. The second approach is preferred if you really need to make an arraylist from … Read more

syntax error: insert } to complete ClassBody

You really want to go to the top of your file and do proper and consistent indention all the way to the bottom. For example… Odds are, somewhere along the line, you are missing a }. Your description isn’t super clear, but if the code you posted is how you actually have it formatted in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)