Questions tagged as 'java'

1
answer

What's the difference if I instantiate a class within the method or if I instantiated only once?

Instance of a class each time I call the method: public String formatar(int valorFormatar){ DecimalFormat df = new DecimalFormat("###,###,###"); return df.format(valorFormatar); } Now an example of making a single instance of the cl...
asked by 24.04.2017 / 15:08
3
answers

Handle String in JAVA?

I have a query of SQL that the content brings me like this: [email protected];[email protected] I need only the first address, I have to disregard everything that is from ; ?     
asked by 03.04.2017 / 20:35
2
answers

Delete duplicates of values in ArrayList [duplicate]

I have the following ArrayList<Integer> : ArrayList<Integer> sequencia = new ArrayList<>(); sequencia.add(2); sequencia.add(11); sequencia.add(12); sequencia.add(13); sequencia.add(14); sequencia.add(14); System.out.p...
asked by 27.12.2017 / 17:55
1
answer

EL JSP does not work

Servlet code: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { token = "teste"; request.setAttribute("token", token); System.out.println(token); RequestDispa...
asked by 15.12.2017 / 14:21
2
answers

Validation in ATM

The user starts by putting a name for the account and the starting balance, here already has a problem, I want you can not enter negative values or broken numbers In the option deposit also I want to be able to enter negative numbers or broke...
asked by 14.12.2017 / 11:57
1
answer

Organize layout files in Android studio

Next, I have a project that in the end will be huge. Currently I have finished 1 module from a total of 4 modules and it is already full of layouts, etc. Here's an image for you to know about the file you have: And there are still a lot...
asked by 22.12.2017 / 17:09
1
answer

Changing the xml by java

I wanted to know if there is a way I can change layout="@layout/app_bar_main" of <include> by java <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.androi...
asked by 05.03.2018 / 03:17
1
answer

How to change final property from Java to C #?

What property in C # is corresponding to final of Java, I need to change my variables final String mensagem = "Tokio Marine Seguradora S.A."; to something corresponding in C #. using System; namespace ConsoleApplication { pu...
asked by 09.09.2016 / 19:58
1
answer

Error while deploying on glassfish server

Project failed on server after deploy. glassfish 4.1 Project cdi, jsf, primefaces, jpa   WELD-000335: Context is already active at org.jboss.weld.context.AbstractConversationContext.activate (AbstractConversationContext.java:233) at org .j...
asked by 04.09.2016 / 16:38
2
answers

What is the class to draw circle on Android?

I know the%% class for rectangle and for circle private Rect retangulo = new Rect(); What is the class to draw circle on Android?     
asked by 11.02.2017 / 01:14