java

java

  • All Sites

4 answers

Merge two arrays in third array also sort the third array in ascending order

I want to write java program to merge two arrays in third array. Also sort the third array in ascending order. But duplication of digit is not allowed..how can i write this program. This is what i ...

4 answers | 1 min ago by bhagyasri patel on Stack Overflow stackoverflow.com
1 answer

What's wrong with this format string?

I have a string like this: <string name="q_title" formatted="false">Item %d of %d</string> I'm using it in String.format like this: String log = ...

1 answers | 1 min ago by Alex on Stack Overflow stackoverflow.com
0 answers

Java String comparison not working with .equals( ) method

I want to get all instances of jpg files from the "search results" page of Amazon using several while loops. I have included system.out.println statements to help me trace through what my code is ...

0 answers

java gson how to return a string value with white space

how can i modify my main class so as to receive value without loosing the white space here is a portion of my main class StringBuilder sb = new StringBuilder(); Scanner s = new ...

6 answers

Understanding inner generic classes

I wrote the following code: public class Test<T> { public void method(){ B b = new B(); } public class B{ } } //Some method in some class contains the following lines ...

6 answers | 1 min ago by St.Antario on Stack Overflow stackoverflow.com
1 answer

Android Push Notifications Using Sinch and Parse

I'm looking at the push notifications tutorial for Android here: https://www.sinch.com/tutorials/send-push-notifications-android-messaging-app-using-gcm/, and I'm wondering how can I apply the same ...

1 answers | 2 mins ago by Navio53 on Stack Overflow stackoverflow.com
3 answers

Java GUI - How to append text to JTextArea from a static method?

I'm doing a simple exercise about client - server chat using Java IO. This is my code structure: public class ChatRoomClientGUI{ private JTextArea textAreaMessages; private JTextField ...

0 answers

Returning Arraylist<String[]> from method in MyBatis?

I would like to return an ArrayList of String Arrays from my MyBatis method so that I can iterate through the Arrays inside to create objects. I tried this: @Select("SELECT PSS_PMT_WTXMETADATA.* FROM ...

5 answers

No message body writer found : JSON : Apache CXF : RestFul Webservices

I am using Apache CXF for making a simple restful application. I have a client class which posts a JSON object to the server and server returns back a JSON after some manipulation. but when i execute ...

5 answers | 2 mins ago by Sikorski on Stack Overflow stackoverflow.com
1 answer

In java library “jaunt”, how to click a button which is not of type=“submit”?

I am doing a web scraping using jaunt java library. I find code to submit a "submit" button in the examples and the tutorials available. But how to click a normal button which is not of type ...

0 answers

Need to generate dynamic sheets and add it in the Report excel from selenium web driver

Im having 4 devices to be tested. And I'm having the testReport.xlsx excel report file having only 1 sheet(homepage attributes result). I want through selenium scripts new sheet(2nd sheet) should be ...

3 answers

How to add JBoss Sever in eclipse?

I am new in Jboss i have just installed Eclipse and added project on it now i will want to deploy these projects in Jboss but when i checked eclipse add server wizard its not shwing Jboss in the ...

2 answers

Reusing SQLite Connection or connect every time?

first of all, sorry for my english, i'm using google translate. I'm making a java app that use SQLite database to store products information. For get the info, i made a class with static methods, and ...

2 answers | 6 mins ago by Enzo on Stack Overflow stackoverflow.com
6 answers

Java - Static initializers versus default values for static variables

I was doing some reading on Java classes, and I came upon static initializers. However, I can't see the point of using them when you can just set default values in the first place. For example, ...

6 answers | 8 mins ago by lor on Stack Overflow stackoverflow.com
0 answers

Maven shading MongoDB

I use the mongoDB dependency for my project. I tried Maven shading for the external libary but it does not work! My pom.xml: project xmlns="http://maven.apache.org/POM/4.0.0" ...

2 answers

EWS Java Api connecting to office 365

I am suppose to get calendar details in my code but I decided to check first if I could connect to outlook 365. public static void main(String[] args) throws Exception { ExchangeService ...

2 answers | 8 mins ago by James on Stack Overflow stackoverflow.com
3 answers

Java Swing - Where do ActionListeners belong according to MVC pattern?

I'm currently writing a template Java application and somehow, I'm not sure about where the ActionListeners belong if I wanted to cleanly follow the MVC pattern. I started with an absolute simple ...

3 answers

Java overriding instance and static method execution

In the below program I am overriding a static and a instance method, When I am calling instance method using superclass that time it is executing subclass method but in case of static method it is ...

3 answers | 11 mins ago by Rohit Funde on Stack Overflow stackoverflow.com
1 answer

Java.Подсчет количества повторных элементов в массиве

Здравствуйте. вопрос от начинающего)) Есть массив arr, размером n (не менее 20 элементов). Данные массива заполнены рандомно и это только числа от 0 до 9. Подчитать количество повторений для каждого ...

1 answers | 11 mins ago by Rouzs Baker on Stack Overflow на русском ru.stackoverflow.com
0 answers

Luncene Hibernate-Search - Filtering Query-String

Is there a way to filter a query string which contains wildcard-stars? The goal: I want to find the text phrase "The capital of germany is Berlin" out of many others, when my query string is capi* ...

1 answer

TextToSpeech synthesizeToFile как узнать что файл создан?

Данный метод сохраняет синтезированный звук в файл file: myTTS.synthesizeToFile(text, null, file, null); Есть ли возможность сохранять данный звук в массив, минуя сохранение в файл? Для данного ...

4 answers

Spring interface injection example

No one so far was capable of providing a working correct example of interface injection in Spring Framework. Martin Fowler article is not for mortals, everything else just words positioned in a very ...

0 answers

Upload de Fotos Múltiplo JSF

Estou precisando fazer uma tela de cadastro, onde o usuário poderá escolher até 5 fotos para salvar. Estou usando JSF 2.2 gostaria de saber a melhor maneira para isso, sem usar primefaces ou ...

2 answers

Add a caesar cipher on java chat

So, I just want to add caesar cipher on my java chat application, how do I add them? I want to encrypt client server and then decrypt server on the server. By the way, here is my java chat code : ...

4 answers

XML Parsing from Java Rest Service Response

I am getting the below XML response from Java Rest Service. Could anyone tell me how to get status tag information? <operation name="EDIT_REQUEST"> <result> ...

4 answers | 14 mins ago by String on Stack Overflow stackoverflow.com
0 answers

Eclipse RCP: How to programmatically create file/folder in workspace

Project is developed for Eclipse Luna. I tried to programmatically create file/folder in workspace using code try { fd.create(true, true, null); } catch (CoreException e) { ...

3 answers

Curly Braces not working in Eclipse

See the image, basically if I go to enter shift+[ or shift+] aka { or } in eclipse I expect the editor to update the .java source with a { or }. Instead it seems to be indenting... Now I'm using a ...

5 answers

JMeter environment specific configuration

I have several JMeter test plans which should be executed in different environments, say Dev, Test, UAT, Live. In each test plan I would like to have a simple way to specify which environment to use. ...

5 answers | 15 mins ago by kan on Stack Overflow stackoverflow.com
1 answer

How To Do Recursive Observable Call in RxJava?

I am quite new to RxJava (and Reactive paradigm in general), so please bear with me. Suppose I have this News and this nested Comment data structure: public class News { public int id; public ...

0 answers

Islands strategy Game Base Distance

I am creating a strategy game in Java, for which I am now writing a map editor. Before the game starts, the player makes a map with a number of islands and a number of resources on each island. After ...

15 30 50 per page
1 2 3