Java Multiple comparision in java

Java
Pardon me if this is a stupid question.. I was wondering if there is any support for following comparison in Java: (a, b, c .... != null) in place f...
2 years ago

Java starting another Java Application

Java
I am in the process of building a wrapper jar for a jar that I built. It will handle updating the main application and making sure users are valid use...
2 years ago

Arrays in Java - Core Java

Java
In This Question A value is "everywhere" in an array if for every pair of adjacent elements in the array, at least one of the pair is that value. Retu...
1 year ago

java java.lang.outofmemoryerror: java heap space

Java
Okay so im programming a game for my A-Level computing project, and so far everything has gone okay. I finished the framework, and started implementin...
3 years ago

Java Enum Methods

Java
I would like to declare an enum Direction, that has a method that returns the opposite direction (the following is not syntactically correct, i.e, enu...
2 years ago

What difference betewen [\s\S]*? and .*? in Java regular expressions?

Java
I have developed a regular expression to identify a block of xml inside a text file. The expression looks like this (I have removed all java escape sl...
2 years ago

Why can you have a duplicate variable name in java for a variable outside of a method?

Java
so I am learning java and I understand that you cannot name a variable declared within an inner scope the same name as a variable declared in an outer...
2 years ago

How can I match a regex in a switch statement?

Java
I'm trying to match tokens against a switch statement in a function, and one of those tokens needs to be able to identify any string or any numbers de...
2 years ago

JTextArea is not automatically scrolled on printing in SwingWorker

Java
My problem is that the JTextArea with JScrollPane added is not scrolling to the newest line printed (the scroll bar stays at the top). The caveat is t...
2 years ago

How to change a bitmap's opacity?

Java
I have a bitmap: Bitmap bitmap = BitmapFactory.decodeFile("some/arbitrary/path/image.jpg"); But I'm not going to display the image to the user. I w...
2 years ago

Cut the sticks: Hackerrank warmup challenge

Java
I've been trying to solve the warmup challenges on Hackerrank. For this particular challenge - https://www.hackerrank.com/challenges/cut-the-sticks - ...
2 years ago

Replace Special Character String with anotherString in Android

Java
I am facing a problem and not able to find out the answer. I want to change set of Special character in String and Replace them with another String ju...
2 years ago

Split string to equal length substrings in Java

Java
How to split the string "Thequickbrownfoxjumps" to substrings of equal size in Java. Eg. "Thequickbrownfoxjumps" of 4 equal size should give the outpu...
2 years ago

calling BaseAdapter's notifyDataSetChanged() inside CustomAdapter not refreshing ListView

Java
I have ArrayList<MyObject> data which is populated on the ListView using a CustomAdapter. I've implemented View.OnClickListener in the CustomAd...
2 years ago

When and how to use hibernate second level cache?

Java
I have trouble understanding when hibernate hits the second level cache and when does it invalidate the cache. This is what I currently understand: ...
2 years ago

Eliminating Char from String

Java
I am trying to eliminate all occurrences of 'X' in the String "cleaned" but I keep getting an outofbound exception. What is wrong with my code? I NEED...
2 years ago

Raspberry Pi Coding

Java
I plan on making a digital alarm clock with a raspberry pi, but the only language I'm familiar with is Java. I need to know if the Pi can run java, an...
2 years ago

javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file when loading wav file

Java
i am using java 6 , and i am trying to load wav file, to get its duration as follows: public static double getAudioFileDuration(File file) { ...
2 years ago

How do i get ServletContext object in a simple class file?

Java
I am creating a simple web application. I need to get reference to ServletContext object in that class. How can i get it?
2 years ago

Riot Games API / Get Ingame Player ELO

Java
I have got a question about the RiotGames API. I got a API Token from RiotGames and its limited to 10 Requests / sec, but when I want to read Ingame i...
2 years ago