Their states and variables

Access ready-to-use Telemarketing Data to expand outreach, generate quality leads, and maximize your marketing ROI.
Post Reply
aminaas1576
Posts: 628
Joined: Mon Dec 23, 2024 3:31 am

Their states and variables

Post by aminaas1576 »

For example, if it refers to "immutable", then it will be a constant. If it refers to "mutable", then the variable will not be constant.

The employer may ask what you know about "mutable" and "immutable". Say that "mutable" objects are those objects whose states and their variables can be changed after creation. Give examples of classes: StringBuilder, StringBuffer.

And "immutable" objects, cannot be changed. Give examples of the type String, Integer, Double.

You may be asked to write an immutable class. Write it correctly. Your competence in the eyes of the employer depends on it.

7 Main Java Interview Questions

Question 7: How to pass by reference and by value
In Java, unlike C++, pointers were made implicit to simplify coding. When you create an object, the reference will store the object's address from the "new" operator. If you try to pass such a reference as a germany consumer email list function parameter, you will receive a copy in the place where it is passed. This means that the transfer will occur by value. The copy will refer to the address of the original. Perform any actions on it, the original will change. Specify that such behavior will only work with objects.

If you send a primitive to a method and change it, only the copy will be changed.

There are many more questions that an employer may ask. Here are some of them:

What are primitives and objects?
What is reboot and override?
What is package level access?
Is it possible to overload a "static" method?
What is Memory Model in Java?
Features of using static classes.
Argument types and their number.
Why did you learn Java?
Why use Java language for Backend development?
Tell us about access modifiers.
What do you know about return types?
Explain the relationship between HashCode and Equals.
What does Error mean in Java?
Other tricky and simple questions.
But the top Java interview questions described above are the main ones that will be asked when hiring a coder.

Conclusion
Now you know how to pass an interview and not fail it. Prepare for it thoroughly, reread, repeat in your head everything you learned in Java lessons. Do not get confused when they ask incorrect or provocative questions like 4. This is done specifically to see your stress resistance and intelligence.
Post Reply