Questions tagged as 'java'

1
answer

How to tell who a class will extend at runtime?

I have the class public class Conhecimento{} This class extends from another class "CteProc" Only this CteProc class has "versions" example. v200.CteProc v300.CteProc My problem is that in creating the Knowledge class I need to...
asked by 11.09.2017 / 14:45
1
answer

How to count the number of all instances of a class and their respective subclasses?

I have a class A , where A extends in B and C . I have an instance counter in A . public Class A { ... private int nInstancias = 0; ... public A(){ nInstancias+=1; ... } ... p...
asked by 31.03.2018 / 17:47
2
answers

Doing searches and comparing java

I am developing a program that should request the RA of a student, the RA must be greater than zero. Soon after I want to buy the second RA typed to check if it has not already been registered. I made the code below but it keeps letting me regis...
asked by 06.06.2017 / 16:00
1
answer

I can not add new student to my arraylist

I'm reviewing previous java stuff and in the midst of revising arraylists I found it difficult to add a student to the list. Each student has the following fields: name, type of student, type of course, subject 1, 2 3 and ID number. I can...
asked by 16.06.2017 / 01:16
1
answer

Pass values from FirebaseRecyclerAdapter

How do I pass an object when I click on a recycler view item and am using a FirebaseRecyclerAdapter ? The way I'm doing is working, I create a list, and in the populateViewHolder method I add the object I want to pass in a list,...
asked by 06.06.2017 / 05:29
1
answer

Equivalence of RMI (Java) in C #

What is the equivalence of RMI (Remote Method Invocation - Java) in C #?     
asked by 27.06.2017 / 20:11
1
answer

How to save a localdate in a mysql table?

I have a table book that has a column of type "Date" and in my java code I have a field of type "localdate". I need to save the data from the "LocalDate" field in the table however I am finding it difficult to do this, any suggestions? Java:...
asked by 25.06.2017 / 20:52
1
answer

Is this a kind of "Anonymous Implementation"?

Since you do not instantiate interfaces, what the code below does with the interface Comparator ? Collections.sort(obj, new Comparator<T>() { @Override public int compare(T t1, T t2) { return 0; } }); It...
asked by 16.08.2017 / 21:36
1
answer

REGEX - problem with validation

I need to do the following validation:    apostrophe , hyphen , hyphen () and numbers (0-9) For this I did the following: import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexTest { /** validação *...
asked by 08.08.2017 / 23:13
1
answer

How to leave part of the JLabel text in bold

Is there any way to leave only a portion of the bold text of a JLabel? For example: label.setText("apenas esta parte em <b>negrito</b>"); But this code snippet prints the 'b' on the screen too.     
asked by 11.08.2017 / 16:55