Questions tagged as 'java'

2
answers

Exceptions in Java

I would like to know how to create my own exception to control that the notes only have the rank of 1 to 10, that if it is not fulfilled skip a message Code: System.out.println("Introduca fecha de nacimiento"); do{...
asked by 27.08.2017 / 10:53
2
answers

Do you know if something is done in the DB from the program? [closed]

I want to detect when a record is made in my database, that at the database level is a trigger but at the programming level, how could I verify if a certain insert was just made in a certain table? I work with JAVA (version 8), SQL SERVER 2014 a...
asked by 27.08.2017 / 22:18
1
answer

How can I close my android studio application which is the code of that button using cases?

I am working with cases according to the button that you click. I have several buttons but there is one that says close or exit that has the id that I show. If in case you click on that button, you have to close the application or in other words...
asked by 02.09.2017 / 02:39
1
answer

Error when programming in android studio

I do not know why it tells me that the Método Lugar() can not be applied in the class Lugar for its parameters that we passed to it. package com.example.mislugares; public class Lugar { public String getNombre() { return nom...
asked by 13.09.2017 / 23:28
2
answers

Button to close Activity in Android studio

I have a button on my second activity (pre-messages) <Button android:layout_width="50dp" android:layout_height="50dp" android:id="@+id/Button40" android:src="@drawable/back" android:layout_alignParentBottom="true" an...
asked by 18.08.2017 / 18:04
1
answer

Do not execute Try / Catch block in Form

I made a basic calculator with forms and when wanting to manage the ArithmeticException() by zero it seems not to enter the catch and execute the sentences that I define for such a case (neither System.out.println, nor JOptionPane.showMes...
asked by 23.08.2017 / 20:51
1
answer

What is the difference between eager and lazy? [closed]

What is the difference between eager and lazy? when I use them an entity Manager retrieve the entities of a database?     
asked by 24.08.2017 / 14:57
2
answers

Treatment of exceptions within a loop

I intend to read two whole numbers while the two data read are not correct. That is, if in any of the two data something that is not an integer is introduced, the do-while loop is repeated again. Next I leave the code: int a = 0, b = 0; boole...
asked by 18.10.2017 / 09:44
1
answer

In what way can I go through the vector?

How can I do to show all the information of all the Clients using a Vector ? import javax.swing.*; import java.util.*; public class AgregarClientes { public AgregarClientes() { Vector vector = new Vector(); Cliente...
asked by 26.10.2017 / 18:35
2
answers

Writing and reading files serialize an array

I have the following program: package Exercici2; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java...
asked by 21.09.2017 / 19:15