Skip to content

Tag Archives: Class and Object

In this article, we will discuss the differences between the class and an object. Class: A class is the building block that leads to Object-Oriented… Read More
The Requirements Model defines a set of analysis classes. Each describes some element of the problem domain, focus on an aspect of the problem that… Read More
The term Object-Oriented explains the concept of organizing the software as a combination of different types of objects that incorporates both data and behavior. Hence,… Read More
Let’s understand one of the key principles of SOLID principles group namely, Dependency inversion principle. Dependency inversion principle is one of the principles on which… 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
Which of the following is true about the following program #include <iostream> class Test { public:     int i;     void get(); }; void Test::get() {     std::cout… 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
Predict the output of following Java program? class Test {   int i; }  class Main {    public static void main(String args[]) {       Test t;       System.out.println(t.i); … Read More
Assume that an integer and a pointer each takes 4 bytes. Also, assume that there is no alignment in objects. Predict the output following program.… Read More
Which of the following is true? (A) All objects of a class share all data members of class (B) Objects of a class do not… Read More
class Test {     int x;  }; int main() {   Test t;   cout << t.x;   return 0; } (A) 0 (B) Garbage Value (C) Compiler Error… Read More