javac: file not found: first.java Usage: javac

I have a filename named “first.java” saved on my desktop in notepad++. When I run the cmd command “javac first.java” it gives me this error. I know you are required to go to C:\Programfiles\java\jdk. and in my C:\Program Files\Java\ I have thesE folders “jdk1.8.0” “jre6” “jre8” In C:\Program Files (x86)\Java I have this folder“jre6” The … Read more

Sort a Map by values

I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values. Since the values are not unique, I find myself converting the keySet into an array, and sorting that array through array sort with a custom comparator that sorts on the value associated with the key. … Read more

How to pass a function as a parameter in Java?

Java 8 and above Using Java 8+ lambda expressions, if you have a class or interface with only a single abstract method (sometimes called a SAM type), for example: then anywhere where MyInterface is used, you can substitute a lambda expression: For example, you can create a new thread very quickly: And use the method … Read more

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