Questions tagged as 'java'

2
answers

Print twice "Enter the student's name" within the for [duplicate] cycle

I need you to ask the name of the students after having declared the number of students, but when entering the amount does not allow me to enter the name of the first student and I have one round of the cycle, for example: if I say that I have...
asked by 23.05.2018 / 03:02
3
answers

Constructor using String

I have to make a constructor in the class CancionImpl that receives a string with the values of the properties separated by semicolons (;), in the following order: type id String , artist type Artist, duration in seconds, type name...
asked by 29.05.2018 / 17:37
2
answers

Are the JavaEE libraries in the JDK?

I have a JavaEE code that was delivered to me and I am trying to make it run to create a module from there, among the several libraries that are being imported are the following: import javax.ejb.SessionContext; import javax.ejb.Stateless; imp...
asked by 01.10.2017 / 20:55
4
answers

Sort arrangement from lowest to highest

public static void main(String[] args) { int [] a = {7,2,4,8,3,9,1,5,10,6}; int menor; for(int i = 0; i < 10; i++){ menor = a[0]; if (a[i] < menor){ menor = a[i]; } else{...
asked by 01.10.2017 / 05:22
4
answers

Operator! = does not work as I expect in Java [duplicated]

I am trying to solve it because in my do-while function when executing it within my program, if I type "Q" or "q" the execution continues instead of exiting the loop: public void enroll() { // Get inside a loop, user hits Q to exit S...
asked by 23.03.2018 / 23:15
4
answers

How to correctly read a file ignoring certain words in Java?

How can I read this .txt file, ignoring the words: Id book: Title: Editorial: List of authors: and ignore the entire line: "------- Text:". Reference image: I used this code to read the author's code and it works ver...
asked by 24.03.2018 / 02:05
1
answer

Mark movements available in chess

I hope you can answer the question I have. What I want to do with my chess program is that when I select a piece of the board I can mark all the boxes where this piece can move, an example would be the peon, assuming it is the first move that...
asked by 04.04.2018 / 07:19
1
answer

Error with Scanner when ordering an integer nextInt () and then a String nextLine ()

I'm asking for a string to insert into a file, if the file does not exist I think so and if it exists I rewrite it, it seems simple but for some reason it does not ask me to speak, the instruction is skipped. I do not understand anything because...
asked by 13.05.2018 / 12:09
3
answers

Debug-Log from a distance? Android Studio

I am developing an app which has problems with two versions of Android, it has already been installed in different android, 4.4.4, 5, 6. but there are two smartphones that are stopped the app one is version 6.0.1 and the other andreo 8 oreo. I d...
asked by 16.05.2018 / 17:21
2
answers

Doubt with POO exercise in Java - problem with array

I have a question with an exercise that says: Create a Book class with loan, return and toString methods. I want the vector to grow as the number of books grows, but in codigo.length , codigo appears as not being initialized. Wha...
asked by 03.03.2018 / 23:39