Skip to content

Tag Archives: Java-Class and Object

A KeyValue is a Tuple from JavaTuples library that deals with only 2 elements – a key and a value. Since this KeyValue is a… Read More
A LabelValue is a Tuple from JavaTuples library that deals with only 2 elements – a label and a value. Since this LabelValue is a… Read More
Prerequisite : Inner Classes in Java  1. What will be the .class file name of the Inner class?  JAVA class Outer {     class Inner {… Read More
Cohesion in Java is the Object-Oriented principle most closely associated with making sure that a class is designed with a single, well-focused purpose. In object-oriented design,… Read More
Synchronization:  Synchronization is a modifier that is used for the method and blocks only. With the help of a synchronized modifier, we can restrict a… Read More
JavaBeans are classes that encapsulate many objects into a single object (the bean). It is a java class that should follow following conventions: Must implement… Read More
In Java, it is possible to define a class within another class, such classes are known as nested classes. They enable you to logically group… Read More
Nested Classes in Java is prerequisite required before adhering forward to grasp about anonymous Inner class. It is an inner class without a name and for… Read More
Object class is present in java.lang package. Every class in Java is directly or indirectly derived from the Object class. If a class does not… Read More
Predict the output of the following program. class Test {     int a = 1;     int b = 2;        Test func(Test obj)     {         Test obj3… Read More
Predict the output of the following program. class Test {     int a = 1;     int b = 2;        Test func(Test obj)     {         Test obj3… Read More
Predict the output of the following program.     class First {        void display()     {         System.out.println("Inside First");     } }    class Second extends First {… Read More
Predict the output of following Java program. class demoClass {     int a = 1;        void func()     {         demo obj = new demo();         obj.display();     }… Read More
class demo {     int a, b;            demo()     {         a = 10;         b = 20;     }            public void print()     {         System.out.println ("a = "… Read More
Predict the output of following Java program class Test {   int i; }  class Main {   public static void main(String args[]) {        Test t =… Read More

Start Your Coding Journey Now!