Questions tagged [java-10]

Use this tag for questions specific to Java 10, which is version 10 of the Java platform, released on 20 March 2018. In most cases you should also specify the java tag.

Oracle announced the general availability of Java SE 10 (JDK 10) on March 20, 2018.

JDK 10 is a production-ready implementation of the Java SE 10 Platform Specification, as specified by JSR 383 in the Java Community Process.

Key features include:

  • Local-variable type inference: enhances the Java language to extend type inference to declarations of local variables with initializers.
  • Parallel Full GC for G1: improves G1 worst-case latencies by making the full GC parallel.
  • Application Class-Data Sharing: optimizes startup time and footprint by extending the existing Class-Data Sharing ("CDS") feature to allow application classes to be placed in the shared archive.
  • Experimental Java-Based JIT Compiler: enables the Java-based JIT compiler, Graal, to be used as an experimental JIT compiler on the Linux/x64 platform

Other document links - Release Notes and API JavaDoc

402 questions
-2
votes
2 answers

Type inference: Generics, "var"

I thought the Java compiler (Java 11) could infer by itself the actual generic type, if I gave it enough hints, for example when the generic type is a method parameter and I provide as a parameter an instance of the actual type. For example, I have…
rapt
  • 11,810
  • 35
  • 103
  • 145
-2
votes
1 answer

Can't run or import JARs with Java 10 and Java 11

I am unable to run .jar archives using Java 10 or Java 11 (they exit with NoClassDefFoundError). Likewise, I am also unable to import .jar archives into a Java Project; they appear in the Classpath, but Eclipse says that the import cannot be…
Lazy Wolf
  • 97
  • 3
  • 10
-2
votes
1 answer

Did Java 10 eliminate for each loops?

I recently installed Java 10 and upgraded my Maven project to Java 10 then. I have a block of code where I'm trying to loop over a list of objects(in this case TableModelListeners from Swing's JTable system). This code is reported as an error…
Seth D. Fulmer
  • 490
  • 1
  • 4
  • 21
-2
votes
1 answer

What is local-variable type inference is JDK 10

I was going through new features in java 10. But I could not understand what is local-variable type inference? Can someone please explain.
Mehraj Malik
  • 14,872
  • 15
  • 58
  • 85
-3
votes
2 answers

How to change a variable type in Java?

I have two objects: Employee E PTEmployee PE I need to do the following manipulation EV=E EV=PE I believe I would need to do the following: var EV = E But then when I set EV = PE, I cannot access the Class PTEmployee methods, because the IDE…
-3
votes
2 answers

Initialization of Main() in java and seeking alternative code

I am given a following partial Java code: public static void main(String[] args) { var main = new Main(); main.start(); } I don't understand the initializing in Line 2 (Main()). Also, what is the datatype of Main()? Suppose, I don't want to use…
Ricky
  • 79
  • 1
  • 8
-3
votes
2 answers

Type mismatch for Math.pow and operator undefinded - Java

I'm working on an assignment to calculate trajectory based on speed and angles and I'm getting a couple of errors in my calculation that I don't understand how to fix. The program works like this: reads in values from a text file into 2 int arrays…
-3
votes
1 answer

what does overwrite existing source file mean while converting webapp to war file

what does export source file mean. will it make it more stable and should i choose optimize for a specific run time
-4
votes
2 answers

how can I replace java 10.0.1 to java 1.8.0

/usr/libexec/java_home -V Matching Java Virtual Machines (2): 10.0.1, x86_64: "Java SE 10.0.1" /Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home 1.8.0_181, x86_64: "Java SE 8"…
-5
votes
1 answer

Java 10 'var' will spawn a bug without full rebuild

Please refer below example. ==== before ==== ---- A.java --- var userAccounts = userService.getUserAccounts(); --- B.java class UserService { public OldUserAccounts getUserAccounts(); } ==== after ==== ---- A.java --- var userAccounts =…
Akila
  • 1,258
  • 2
  • 16
  • 25
-6
votes
1 answer

var with generic enumMap declaration

Is this declaration // version 1 EnumMap> types = new EnumMap<>(Type.class); the same as this: // version 2 var types = new EnumMap>(Type.class); I think it's the same, because I can also write…
nimo23
  • 5,170
  • 10
  • 46
  • 75
-6
votes
2 answers

How to use class instead of interface for lambda param

Right now I have this: public static interface AsyncCallback { public void done(E e, T v); } I want to convert it to this so I use a boolean property on it: public abstract static class AsyncCallback { boolean shortcircuit…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
1 2 3
26
27