Java
-
Java – how’s it going? Listening location setting is turned on (android app)
So I spent weeks working on my Android application and studying the best way to achieve what I need to do, but I still…… -
Java – try to parse the date time in PDT into zoneddatetime representation
How can I parse the date time value in the PDT time zone? 06/24/2017 07:00 AM (PDT) I want to maintain time zones so t…… -
How do I round numbers in Java?
For this program, I write the number of minutes I am accepting user input, and then round it to the next hour >1 mi…… -
If HashMap Java exists, it gets the value
I want to get a value from hasmap, but sometimes the value does not exist, so I did this: int var = 0; if (hashMapHous…… -
Java – add string value
Here is the Java problem: Solution String str = "abcde"; String str = "abcde"; System.out.println(getIncrementedString…… -
Java – use durationformatutils to format periods in a good way
This is very effective: out.println(DurationFormatUtils.formatPeriod( new Date().getTime(),mat…… -
Collision detection between two rectangles in Java
I have two rectangles, a red rectangle (movable) and a blue rectangle When a collision occurs between blue and red rec…… -
Java – how to use regular expressions to check whether HTML documents contain non empty script tags
I try to check whether an HTML document contains script tags that are not empty using regular expressions Regular expr…… -
Java – how do I know what exceptions can be thrown from a method?
How do I know what exceptions a method call might throw? Solution Look at the throws clause of the method signature to…… -
Java EE – Liferay 7 service builder does not automatically update the database
In my Liferay 7 project, service builder can well generate the file tables SQL (with complete SQL), but it will not be…… -
Java – why doesn’t my rating bar change the user’s touch?
I tried to add a rating bar to my campaign But I can't add or delete stars on the user's touch What should I add? <…… -
How to “time out” functions in Java?
private String indexPage(URL currentPage) throws IOException { private String indexPage(URL currentPage) throws IOExce…… -
Java – questions about reversing strings
I'm trying to do a simple string operation The input is "murder". I want "murder" I tried this String str = "murder"; …… -
Default initialization of private fields in Java
Suppose I have a class named person: class Person{ private int num = 1; } When calling an empty constructor for th…… -
Java – how to prevent HashMap or treemap from replacing previous values
If it already exists, how can I prevent HashMap or treemap from replacing the previous key value? In addition, I want …… -
Java – find element or check if it exists in array / list?
I'm a novice. I really don't understand how this works I made a list of room information: List<Room> rooms = new…… -
Java – Tomcat and VM
It's really hard for me to understand where Tomcat actually runs It is executed in the JVM, which executes servlets Or…… -
Java – how to parse the “DD mm” date format to get the current year? “
I have to use java to parse the date in "17 - Jun" format The problem is that when I try to parse the "DD mm" format u…… -
Java – naming convention for O / R mapping
I map my database tables to my Java objects Generally speaking, I name my form in the plural, because the form holding…… -
Java – combine allmatch, nonematch, and anymatch on a single stream
I think there is the following logic: (I know it doesn't work because it consumes the stream more than once) But I don…… -
Java – system. Java on Windows Where’s err?
I have a Java GUI based application that writes some diagnostic messages to system Out and system err. Where are these…… -
Exception in Java platform library
Sometimes I check the Java platform library for inspiration There are many good design solutions, such as this questio…… -
Reduce map using java 8 stream API
I have a map of the following table: Map<Integer,Map<String,Double>> START Make inner an internal map, i.e…… -
The best way to translate this java code into kotlin
URL url = new URL(urlSpec); URL url = new URL(urlSpec); HttpURLConnection connection = (HttpURLConnection)url.openConn…… -
Java – call again: < >
What's this called? List<String> ids = new ArrayList<String>(sectionIDs); (< > section) I know this …… -
In Java, if only the last numeric item is replaced, what is the best way to sort an integer array?
This is an array of integers Solution Take the last element as an insertion sort -
Java – when using batik in webapp on tomcat, “sax2 driver class org.apache.crimson.parser.xmlreaderimpl not found”
This may be related to the classpath problem, but I'm not sure yet because I don't have this error on some machines Th…… -
Java reference
Is there a way to find all references to objects (in Java)? I have an object cache and want to scan it regularly to se…… -
Java – make columns uneditable in JTable
I use NetBeans to create a masterdetail simple form, and I have a JTable related to the database I want to edit the co…… -
Java – what’s faster – storing data in lists or databases? (robot)
I am currently working on a school project (Android application). We should store user fee and income information in t…… -
How to create an autocomplete pop-up window in jtextpane in Java?
I am creating an SQL editor I am using jtextpane as the editor I want to implement autocompletion for table names such…… -
Java – the question I tripped over in the interview
I was asked several Java interview questions. I don't know how to solve them. I can use some answers >Write a metho……
