Telegram Web Link
✍️✍️......🍃🍃🍃......✍️✍️
Q) What is the return type of the hashCode() method in the Object class?
Anonymous Quiz
32%
Object
30%
int
22%
long
16%
void
Please open Telegram to view this post
VIEW IN TELEGRAM
The default value of Boolean is False
✍️✍️......🍃🍃🍃......✍️✍️
Data Type
Default Values

Byte
0

Short
0

Int
0

Long
0

Float
0.0

Double
0.0

Boolean
false

Char
\u0000′ or null

Join us @Compu
✍️✍️......🍃🍃🍃......✍️✍️
Why use inheritance in java
For Method Overriding (so runtime polymorphism can be achieved).
For Code Reusability.
Terms used in Inheritance
Class: A class is a group of objects which have common properties. It is a template or blueprint from which objects are created.
Sub Class/Child Class: Subclass is a class which inherits the other class. It is also called a derived class, extended class, or child class.
Super Class/Parent Class: Superclass is the class from where a subclass inherits the features. It is also called a base class or a parent class.
Reusability: As the name specifies, reusability is a mechanism which facilitates you to reuse the fields and methods of the existing class when you create a new class. You can use the same fields and methods already defined in the previous class.
join us @Compu
✍️✍️......🍃🍃🍃......✍️✍️
If you want to print a welcome message before the main method is executed in Java, a static block is the best place to do that. What is a static block? A static block is nothing but a code block just like instance block. The static block does not depend on any object.

Join us @Compu
✍️✍️......🍃🍃🍃......✍️✍️
A class can have any number of static initialization blocks. The execution of multiple static blocks will be in the same sequence as written in the program.

Join us @Compu
✍️✍️......🍃🍃🍃......✍️✍️
Functional Interface in Java is also called Single Abstract Method (SAM) interface. From Java 8 onwards, to represent the instance of functional interfaces, lambda expressions are used. Lambda expressions are anonymous (don't have names) shortcode blocks that can take parameters and return a value just like methods.

Join us @Compu
✍️✍️......🍃🍃🍃......✍️✍️
Synchronization in java is the capability to control the access of multiple threads to any shared resource. In the Multithreading concept, multiple threads try to access the shared resources at a time to produce inconsistent results. The synchronization is necessary for reliable communication between threads.

Join us @Compu
✍️✍️......🍃🍃🍃......✍️✍️
Default methods are methods that can have a body.
The most important use of default methods in interfaces is to provide additional functionality to a given type without breaking down the implementing classes. Before Java 8, if a new method was introduced in an interface then all the implementing classes used to break.
Join us @Compu
✍️✍️......🍃🍃🍃......✍️✍️

The Predicate in Java 8 is one of the types of Functional Interfaces. Functional Interfaces were introduced in Java 8 to support functional programming in the object-oriented world of Java. The Predicate is one of them, which allows programmers to test a specific condition imposed on values or objects.

Join us @Compu
2025/07/04 09:13:34
Back to Top
HTML Embed Code: