Questions tagged as 'java'

2
answers

When I use ObjectOutputStream are the attributes of the parent class also written?

When I use ObjectOutpuStream to write to file, will the parent class attributes also be written?     
asked by 10.02.2014 / 12:53
3
answers

Send e-mail on behalf of the customer

I have a system that serves multiple clients and sends emails to their users (clients of my clients). Today I use my own email account (from my domain), and in the composition of the email I inform the name and email of the client. With th...
asked by 12.02.2014 / 12:57
2
answers

Navigation Drawer customized and colored

Hello, what I wanted to do was to be able to put colorful icons in the navigation, how can I do that? The images I have in my project are colored but in navigation they are only grayish like that. Thanks for the help.     
asked by 12.07.2018 / 20:47
1
answer

How to handle a String in JSON format?

Let's say I get the following content that is stored in a String: { "client_id": 1580, "videos": 4, "remote_urls": [{ "url": "rtsp://aniceurl.com" }, { "url": "rtsp://aniceurl.com" },...
asked by 01.10.2018 / 13:53
1
answer

Does the last statement on a switch need to 'break'?

I was watching some tutorials on YouTube and noticed that some programmers leave the last statement in a block switch without the word break . For example: switch(frutas){ case "abacaxi": abacaxi++; break; case "morango": mo...
asked by 02.01.2015 / 01:42
1
answer

Can enumerations contain methods?

I do not know if the term is this, "abstract methods in a enum ". My question came after seeing this implementation in code review . Until then I had never seen this kind of thing in any tutorial or article pertaining to enum...
asked by 12.12.2014 / 07:21
1
answer

Create and manipulate multidimensional associative array

How can I create a multidimensional associative array in Java? Something similar to this: Array = { "carro 1" : Array { "portas" : 5, "cor" : "preto", "km" : 10670 }, "carro 2" : Array { "portas" : 3...
asked by 12.01.2015 / 15:22
1
answer

What is the most performative way of converting an int to the sum of its digits?

I have a certain int and would like to turn it into another one that is the result of summing your digits in the best possible way. For example: int n = 2601; Should result in 9 since this is the result of 2+6+0+1 . What...
asked by 27.11.2017 / 05:50
1
answer

How to read a list of serialized objects saved in a file in java? [duplicate]

I was looking to work with serialization in java files and read this tutorial on how to write the object in the file and this one on the how to read the file object Then I created the following class that saves the Adreess object in the...
asked by 17.10.2017 / 00:53
1
answer

I do not understand the order of execution of a code

public class Rope { static String result = ""; {result += "c";} static {result += "u";} {result += "r";} public static void main(String[] args) { System.out.print(Rope.result + " "); System.out.print(Rope....
asked by 09.11.2017 / 22:06