Questions tagged as 'java'

3
answers

What is the signature of a method?

A signature of the common method / function or constructor is made up of its name + number of parameters + type of parameters?     
asked by 10.11.2014 / 11:34
4
answers

What good practice when throwing exception within if?

What is the best practice in this case, to use else even though you know that if will throw an exception or not? option 1 (with else ): if (condicao){ throw new RuntimeException("Mensagem"); }else{ System.out.println("Não deu exce...
asked by 14.01.2014 / 11:28
2
answers

What does public static void main (String [] args) mean?

I want to understand what each item of public static void main(String[] args) means in Java and when it should be used.     
asked by 18.10.2015 / 02:10
1
answer

When and how to implement Parcelable vs. Serializable?

After much time using the Serializable implementation in my classes on the Java platform (Android), I discovered Parcelable, but I was in doubt about the following issues below: 1. When to use (choose from) Parcelable vs. Serializable? 2....
asked by 29.10.2014 / 02:34
3
answers

@override mandatory in Java?

If I have an abstract class Pessoa with an abstract method lerNome when I'm implementing this method in my João class should I make use of @Override in lerNome ? The same thing happens when I use interfaces?   ...
asked by 18.09.2014 / 17:36
1
answer

How to remove the borders of a JFrame?

I'd like to remove the borders of a JFrame . I used setUndecorated(true) , however it completely removes and I would like to just leave the title bar of JFrame .     
asked by 29.07.2015 / 23:01
2
answers

Is it possible to have month 13 on a date in Java?

I was looking at the documentation for class Formatter of Java 7, on this link of Oracle itself , when I noticed the following example below: What intrigued me was the example given for the month formatting option, m : which...
asked by 23.04.2015 / 21:08
2
answers

What is the difference and what are the & & & & e | and || in Java?

I was analyzing some possibilities for the implementation of an algorithm and I went to search for this type of & and | , and I read some topics in English but it was not 100% clear to me what it is and where I can use it, it. T...
asked by 04.05.2015 / 20:48
3
answers

Why use get and set in Java?

I learned in college a while ago that I should always use getters and setters to access values in an object and I heard it is for security. p> So I ended up always using and seeing other people using, until I started programming Android and I...
asked by 14.11.2014 / 05:55
4
answers

Check Old Game winner

The algorithm teacher asked us to write a code to play a simple old game in Java. And I already have everything ready, but I'm not too happy with the solution I've got to validate who won the game. I've done a series of if and elseifs to chec...
asked by 08.10.2014 / 13:48