Java (not to be confused with JavaScript or JScript or JS) is a general-purpose object-oriented programming language designed to be used in conjunction with the Java Virtual Machine (JVM). "Java platform" is the name for a computing system that has installed tools for developing and running Java programs. Use this tag for questions referring to the Java programming language or Java platform tools.
What is the main difference between StringBuffer and StringBuilder? Is there any performance issues when decid
What's the advantage of using getters and setters - that only get and set - instead of simply using publi
I'm new to Java EE and I know that something like the following three lines <%= x+1 %> <%= reque
I am relatively new to Java, and often find that I need to sort a Map<Key, Value> on the values. Since
I have a string, "004-034556", that I want to split into two strings: string1="004"; string2="034556"; That
The following print statement would print "hello world". Could anyone explain this? System.out.println(random
I've been looking for a simple Java algorithm to generate a pseudo-random alpha-numeric string. In my si
I came across some Java code that had the following structure: public MyParameterizedFunction(String param1,
What is the main difference between an inner class and a static nested class in Java? Does design / implementa
I know that Java enums are compiled to classes with private constructors and a bunch of public static members.
I've got a nested loop construct like this: for (Type type : types) { for (Type t : types2) {
Use of java.net.URLConnection is asked about pretty often here, and the Oracle tutorial is too concise about i
I understood, I think, that a "Bean" is a Java class with properties and getters/setters. As much as I underst
In Java, arrays don't override toString(), so if you try to print one directly, you get the className + &
Say I have an enum which is just public enum Blah { A, B, C, D } and I would like to find the enum value
From what time I've spent with threads in Java, I've found these two ways to write threads: With imp
Can @Component, @Repository and @Service annotations be used interchangeably in Spring or do they provide any
What is reflection, and why is it useful? I'm particularly interested in Java, but I assume the principle