Questions tagged as 'java'

1
answer

Error opening new Activity

I'm picking up here to get you to click a button to open a new Activity. I looked at the Android documentation on Activity, Intent, methods to create and yet, it does not work. Basically, I did the following steps: I created a new Android...
asked by 30.05.2014 / 03:04
3
answers

File read only by the Android Java application

I'm doing an application that reads images from a folder, but I have a problem, I need to prevent other applications (eg gallery) and even file manager from being able to open this image ... How can I make only my application read (write, del...
asked by 26.06.2014 / 07:06
2
answers

JPA, Oracle and Handling Exceptions

I'm using vraptor 4, JPA and Oracle. But when an exception occurs during persistence, the error code that Oracle generates is not coming along with Exeption. This is the Repository @Repository public class AuthUserRepository { publi...
asked by 19.05.2014 / 22:14
2
answers

Problems in implementing methods

I have the following classes: Port package meu.programa; public class Porta { boolean aberta; String cor; double dimensaoX; double dimensaoY; double dimensaoZ; void abre() { if (aberta == false) {...
asked by 18.08.2014 / 03:19
2
answers

How to count the number of occurrences of a String in a JSONArray?

I'm trying to show the Strings of " specialty " strings that are in my JSON, but when I try to show the count of each "specialty" I can not succeed. JSON [ { "id": "20", "medico": "ACASIO MENDES", "paciente": "APARECIDO SOUZA...
asked by 11.09.2017 / 19:11
3
answers

Interesting question about inheritance and polymorphism

I found this issue of a public tender interesting: Class A public class ClasseA { public int metodoX(){ return 10 } public int metodoX(int n){ return metodoX() + n } } Class B public class ClasseB extends ClasseA{ public...
asked by 12.10.2017 / 16:22
2
answers

@Named does not work JSF

I'm doing a project with jsf 2 and glassfish server when I put @Named on my bean the attributes get null only works with @ManagedBean someone has already experienced this problem     
asked by 18.08.2014 / 16:20
3
answers

Regular expression that accepts only numbers and / or letters in Java

How to develop a regular expression that allows a string to have only numbers and / or letters in any position and quantities? Examples:    a) 000000000a       b) 000000000A       c) AAAAAAAAA0       d) 1AAAAA1113       e) 1...
asked by 16.07.2014 / 23:05
3
answers

Create an object from another class

I have the class Endereco and the class Cliente , I build 2 constructors for Cliente , and one of them is to insert the client name and an object of type Endereco , which works perfectly , but in the other constructor is...
asked by 11.04.2014 / 16:44
4
answers

Index returning -1 in Java ArrayList

Good morning. For study purposes, I am making a simple application in RMI Java that simulates some operations (create account, check balance, debit etc ...) in one, or more, accounts. For each account created I generate an object of type Cont...
asked by 22.11.2016 / 12:38