Principais perguntas e respostas de entrevista e testes online
Plataforma educacional para preparacao de entrevistas, testes online, tutoriais e pratica ao vivo

Desenvolva habilidades com trilhas de aprendizado focadas, simulados e conteudo pronto para entrevistas.

WithoutBook reune perguntas de entrevista por assunto, testes praticos online, tutoriais e guias comparativos em um unico espaco de aprendizado responsivo.

Preparar entrevista

Core Java perguntas e respostas de entrevista

Test your skills through the online practice test: Core Java Quiz Online Practice Test

Pergunta 131. Why isn't there operator overloading?

Because C++ has proven by example that operator overloading makes code almost impossible to maintain. In fact there very nearly wasn't even method overloading in Java, but it was thought that this was too useful for some very basic methods like print(). Note that some of the classes like DataOutputStream have unoverloaded methods like writeInt() and writeByte().

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 132. Can a method be overloaded based on different return type but same argument type ?

No, because the methods can be called without using their return type in which case there is ambiquity for the compiler

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 133. What restrictions are placed on method overloading?

Two methods may not have the same name and argument list but different return types.

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 134. How could Java classes direct program messages to the system console, but error messages, say to a file?

By default, both System console and err point at the system console.

The class System has a variable out that represents the standard output.
The variable err that represents the standard error device. 
Stream st = new Stream (new  FileOutputStream ("withoutbook_com.txt"));
System.setErr(st);
System.setOut(st);

Isto e util? Adicionar comentario Ver comentarios
 

Pergunta 135. What does the keyword "synchronize" mean in java. When do you use it? What are the disadvantages of synchronization?

Synchronize is used when you want to make your methods thread safe. The disadvantage of synchronize is it will end up in slowing down the program. Also if not handled properly it will end up in dead lock.

Isto e util? Adicionar comentario Ver comentarios
 

Mais uteis segundo os usuarios:

Copyright © 2026, WithoutBook.