Skip to content
Advertisement

Tag: java-6

Does WebLogic Server 14 support JDK 6?

I want to migrate to WebLogic server 14 but, Could the Weblogic server 14 support old java versions like 6? Answer The requirements for various versions of WebLogic can be found in a xls file downloadable from this page. WebLogic 14c, in particular, requires Java 8 or Java 11

Varargs in method overloading in Java

The following code doesn’t compile. A compile-time error is issued. reference to test is ambiguous, both method test(int…) in varargspkg.Main and method test(float…) in varargspkg.Main match It seems to be obvious because the parameter values in the method call test(1, 2); can be promoted to int as well as float If anyone or both of the parameters are suffixed by

Get keys from HashMap in Java

I have a Hashmap in Java like this: Then I fill it like this: How can I get the keys? Something like: team1.getKey() to return “United”. Answer A HashMap contains more than one key. You can use keySet() to get the set of all keys. will store 1 with key “foo” and 2 with key “bar”. To iterate over all

@override annotation in JDK 1.6

I’m using JDK1.6. When I implement an interface and in the implementing class, if I give @override before my function names, Eclipse throws an compilation error. i.e. below code is wrong according to Eclipse. If I remove @Override annotation, then the code compiles fine. Does it mean that JDK1.6 does not require us to prefix the @override annotation anymore? Answer

How to set classpath when I use javax.tools.JavaCompiler compile the source?

I use the class javax.tools.JavaCompiler (jdk6) to compile a source file, but the source file depends on some jar file. How to set the classpath of the javax.tools.JavaCompiler? Answer The javax.tools.JavaCompiler#getTask() method takes an options parameter that allows to set compiler options. The following message describes an easy way to set them in order to access the calling program’s classpath:

Advertisement