404 questions
-1 votes
2 answers
69 views
How to revert Java 10 "use local varaible type inference" via save actions?
I checked out the Java 10 option of "use local variable type inference" (JEP 286), but I think it is terrible to replace all type information with just the keyword var - was so much better ...
0 votes
2 answers
121 views
How to set up IntelliJ IDEA to use Java 10 non-LTS version for project development?
I'm looking to switch the default SDK of my project in IntelliJ IDEA to Java 10 specifically. However, when I navigate to the download JDK option within IntelliJ, I notice that there's no vendor ...
0 votes
0 answers
555 views
Java 10 can't connect to gradle on IntelliJ Idea
I've been tasked to help manage an older java spring repository using java 10. Since java 10 are no longer supported I've been unable to use it on my laptop. I use IntelliJ IDEA as my IDE and have ...
0 votes
3 answers
2k views
Java switch case statement is returning different type of values(different data-type) and is assigned to same variable of type var
Following is my code snippet: Scanner sc = new Scanner(System.in); int input = sc.nextInt(); var output = switch (input){ case 1 -> "one"; case 2 -> '2'; case 3 -> 3.14; ...
0 votes
0 answers
350 views
I click on NetBeans icon but just shows me a task bar then it hides, and doesn't open the IDE
I have a problem with NetBeans 12.1 opening, but not showing anything, just opens on taskbar. I try to delete it and re-install but it still doesn't work. My Java version is 10.0.2. This is the ...
-3 votes
2 answers
1k views
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 ...
1 vote
1 answer
847 views
How to get a Map owned by an Object as an attribute from a List of these objects
I have an BOLReference object as follows: private String ediTransmissionId; private List<WorkflowExceptions> workflowExceptions; And the inner WorkflowExceptions looks like below: private ...
1 vote
2 answers
2k views
Why should var keyword not be used in an instance and global variable declaration in Java 10
class Demo3 { // instance variable var x = 50; public static void main(String[] args) { System.out.println(x); } } Reference: https://www.geeksforgeeks.org/var-keyword-...
-2 votes
1 answer
44 views
incon class java iin eclipse is different [duplicate]
I have two class .java but in pdcController.java I cannot do anything: Look the image: Look the icon are different in BandoService works all, but in .pdfController I cannot do anything (for example I ...
16 votes
2 answers
655 views
Java var and inference type ambiguity
Both calls are correct: Collectors.groupingBy((String s)->s.toLowerCase(),Collectors.counting()); Collectors.groupingBy((String s)->s.toLowerCase(Locale.ENGLISH),Collectors.counting()); Since ...
0 votes
0 answers
114 views
To run fuzzy search on text, and no HTTP server
I am writing a Java SE 10 desktop software application. I use Hibernate 5.4.2 ORM framework on the embedded Derby DB. I would like to run fuzzy search on text, which could be in JSON format or even ...
3 votes
2 answers
1k views
How to make Intellij IDEA show Java type hints for inferred local variables only on hover?
Intellij IDEA shows type hints for variables created with the new 'var' feature from Java 10. However, inferred types are so long sometimes that the line length ends up exceeding the width guide as ...
0 votes
0 answers
142 views
Does below class implement correct Java Singleton Object and provide Thread Safety .. It seems so looking at my Unit Test Case
package samples.study; /** * * @author */ public class Singleton { private Singleton(){} private static final Singleton instance = new Singleton(); public static Singleton ...
1 vote
2 answers
213 views
Did I build Java 10 wrong or is it something else? Running MapTool on Pi4 (nearly! something wrong with InteropFactoryN?)
I'm looking for a bit of Java help here. I am trying to run MapTool on a Raspberry Pi 4. No mean feat -- I've installed ubuntu server, so I could get a 64 bit operating system. Then I had to build ...
7 votes
1 answer
716 views
A Checkstyle Rule for OpenJDK's Local Variable Type Inference Style Guidelines
Background: OpenJDK have released a style guide for local variable type inference. I was looking for a checkstyle built in rule that addresses it but didn't found one. What I'm trying to get is pretty ...