I am wondering if there is a way to check: for an abstract class, which classes extend the abstract class. I am using IntelliJ IDEA.For any class to show the type hierarchy (super- and/or subclasses), position the cursor on the class name and press C
I created three certificates -- for the root CA, the intermediate CA and the server. They represent the simple chain of trust: server -> intermediate -> root The question is how correctly put them on the client and the server. I have two options: Pu
this my work I have a problem with the question is the last passenger should not be counted if their weight added to the total passenger weight exceeds the carrying capacity. Thanks. import java.util.*; public class Exam2 { public static void main(St
I'm eager to use the @GrailsCompileStatic annotation in many places of my grails 3.1.7 application. But the main problem is that it doesn't take into account that domains, commands and controllers are 'mixed' with additional methods (like save() or v
When I try to build my project, the Messages Gradle Build reports these messages: FAILURE: Build failed with an exception. What went wrong: Execution failed for task ':app:processDebugResources'. java.lang.IllegalArgumentException (no error message)
I have created a java gui to generate bat files. When I write the bat containing a string like this: "L'uomo più forte" notepad++ shows this: "L?uomo pi- forte" Here is the code: FileOutputStream fos = new FileOutputStream(bat); Writer
Consider the program: public class Test { public static void main(String[] args) { if (Arrays.asList(args).contains("--withFoo")) { use(new Foo()); } } static void use(Foo foo) { // do something with foo } } Is Foo required in the runtime classp
So, let's deal now. I have Parser class where I can get links from html. I've used Jsoup to get links and then I want to add this links to List. I'm using StreamAPI to proceed that. Look at the following code fragment: public static List<Link> getLi
I need write server side part to post a forum reply. I receive a post request with reply text, and attachment which is a base64 encoded string. Is there a way to restore filename and extension from this base64 string, or I need to have them as additi
I am having trouble understanding some code in Java. I have researched around but I am still having trouble fully understanding it. boolean showShip = false; //set the ship to be hidden by default while(!showShip) //dont get this while loop { val = p
I am using Spring REST with Hibernate and I have developed a program in which data is coming from database calculate and it is updated into another table in database. But I want to run this program once in a day at a given time because I want to calc
So I'm making a game, and I want the user to be able to fight crimes. Only I don't want them to be able to fight crimes again for a period of time, a 10 second delay max. I know that I could use Math.Random() somehow, but I'm having trouble figuring
This question already has an answer here: Uploading files in Spring with Tomcat related to the maximum size allowed 1 answer I've read the article "File upload using Spring MVC and annotation configuration" (http://www.raistudies.com/spring/spri
As a part of my code i need to calculate some centrality measure for a graph with 70k vertices and 700k edges. For this purpose I used array and hash map data structures. Unfortunately I ran out of memory at the middle of program. What would be the b
This question already has an answer here: How do you Programmatically Download a Webpage in Java 10 answers How to use java.net.URLConnection to fire and handle HTTP requests 12 answers I'd like to fetch a webpage and save the content as a string? Is
I see this question asked a lot here for Java, but every single one I see seems to be Android-centered: I need a way of getting the user's current latitude and longitude when they call is coming from a computer, not a mobile device. I know that this
I've just started learning Java, and I'm pretty confused at this point. I'm trying to make a program that will average out any amount of numbers that the user would input, but I can't figure out how to allow the user to input as many numbers as they
I want to place implement search in my app for that I need to make a search bar like we see in the google bar image at the end of the text field. I have tried using FrameLayout and I place EditText and image, but it doesn' work ..How do I make it.Use
A few days ago i tried to create a server - client or client Server as an experiment to learn about socket using a thread but then someone told me that i should use swingWorker. I did some research how to use and have implemented it in as practice bu
This question already has an answer here: why byte += 1 compile but byte = byte + 1 not? 8 answers What happens when we try to increment a byte variable using increment operator and also by addition operator. public class A{ public static void main(S
I am trying to make a countdown timer for a game/date in android. I want to create a timer that displays the days, hours, minutes, and seconds to a date I specify with a final variable. The timer then sets text views to show the days, hours, minutes,
I have about 8 date variables (java.util.Date) with different variable names. What's the most efficient/best way of choosing the most recent (max) of these dates?Ideally, store them in a collection - this might make sense in terms of your program des
I would like to return an array from an annotation based Mybatis mapper to avoid the memory overhead of boxed primitives. Is this possible? I tried @Select("select id from some_table") public long[] selectIds(); with no luck.It can as of version
I am developing an application which needs to pop up new JFrame B with different components, when I click on a button on JFrame A. How do I achieve that? I don't want to use the tabs.Use a JDialog , problem solved! See this java tutorial for more hel
So I've been around android for about two years now, and around 6 with java, something that I liked from the very start that i discover them where the Java Convetion, this guide that help me wrote more understandable code you know the typical CalmelC
How to check if my integer can be divided by 3 as below: for(int i=0; i<24; i++){ //here, how to check if "i" can be divided by 3 completely(e.g. 3, 6, 15)? } Use the modulo operator. if(i % 3 == 0) Also see Modulo operation at Wikipedia
We've just started learning Java for my degree and I've been given a folder with various Java classes in, each in their own .java file, with the file name the same as the name of the class it has it in. There is one file which hosts a public class wh
we need run one function periodically in Java web application . How to call function of some class periodically ? Is there any way that call function when some event occured like high load in server and so on . what is crontab ? Is that work periodic
I can't find any reference to what versions of Windows the log4j NTEventLogAppender is supported on. I am specifically interested in whether it works on Windows Server 2008.Consider log4jna, an alternative implementation of NTEventLogAppender that do
I am trying to figure out the best way to use Ant to precompile JSPs that will be deployed to an Oracle application server. Even though I am deploying to an Oracle app server I would like to avoid using Oracle's version of Ant.Oracle's JSP compiler i