DSSSB TGT / PGT · Computer Science

OOP Previous Year Questions

62 OOP (Computer Science) questions asked in DSSSB TGT / PGT previous year papers, each with the correct answer and explanation. Read them free on UTpaper, or attempt the full papers as timed online tests.

  • 62 questions
  • Official answer key
  • Free

Other Computer Science topics

Q1From DSSSB TGT Computer Science Practice Set 5
This question is based on the following C++ code segment and class FUN : class FUN { int CODE ; public : FUN ( ); //Function1 FUN (int C); //Function2 FUN (FUN & F); //Function3 void DISP ( ); //Function4 ~FUN ( ); //Function5 }; void main ( ) { FUN F1 ; ______ // BLANK ______ } Which of the following C++ command/ statement can be written in the line marked as BLANK to invoke the function whose prototype is marked as Function 3 ?
  1. AFUN F2;
  2. BFUN F2 (501);
  3. CFUN F2 (F1);
  4. DFUN F2 = F1;
Show answerHide answer

Correct answer: (C) FUN F2 (F1);

Explanation

Function 3, FUN(FUN &F), is the copy constructor, which runs when a new object is made from an existing one, as in FUN F2(F1). (FUN F2 = F1; also calls it, but C is the direct form.)

Q2From DSSSB TGT Computer Science Practice Set 5
This question is based on the following C++ code segment and class FUN: class FUN { int CODE ; public : FUN ( ); //Function1 FUN (int C); //Function2 FUN (FUN & F); //Function3 void DISP ( ); //Function4 ~FUN ( ); //Function5 }; void main ( ) { FUN F1 ; ______ // BLANK ______ } Which of the following is called a destructor of the class FUN ?
  1. AFUNCTION 1
  2. BFUNCTION 2
  3. CFUNCTION 3
  4. DFUNCTION 5
Show answerHide answer

Correct answer: (D) FUNCTION 5

Explanation

A destructor has the class name with a tilde and no arguments, so ~FUN() (Function 5) is the destructor.

Q3From DSSSB TGT Computer Science Practice Set 5
The teacher provides study material a day before teaching the same thing students read it according to their ability and use the time to complete the assignments in the class with the help of teacher what type of approach is highlighted in the statement?
  1. ABlended learning
  2. BDistance learning
  3. CVirtual learning
  4. DTraditional learning
Show answerHide answer

Correct answer: (A) Blended learning

Explanation

Studying the material before class and using class time for assignments with the teacher is the flipped-classroom model, a form of blended learning that mixes self-study with face-to-face teaching.

Q4From DSSSB TGT Computer Science Practice Set 5
Assessments like unit test and class tests are covered under following ______
  1. ASummative assessment
  2. BPortfolio assessment
  3. CFormative assessment
  4. DCCE
Show answerHide answer

Correct answer: (C) Formative assessment

Explanation

Unit tests and class tests happen during teaching to check progress and give feedback, so they are formative assessment. Summative assessment comes at the end of a term.

Q5From DSSSB TGT Computer Science Practice Set 4
As per NEP 2020, from which class will vocational education be introduced?
  1. AClass 7
  2. BClass 8
  3. CClass 9
  4. DClass 6
Show answerHide answer

Correct answer: (D) Class 6

Explanation

NEP 2020 introduces vocational education from Class 6, including internships, so every student learns at least one vocation.

Q6From DSSSB TGT Computer Science Practice Set 4
This question is based on the following C++ code segment and class FUN : class FUN class FUN { int CODE ; public : FUN ( ); //Function1 FUN (int C); //Function2 FUN (FUN & F); //Function3 void DISP ( ); //Function4 ~FUN ( ); //Function5 }; void main ( ) { FUN F1 ; ______ // BLANK ______ ______} Which of the following is an example of default constructor?
  1. AFunction 1
  2. BFunction 2
  3. CFunction 3
  4. DFunction 5
Show answerHide answer

Correct answer: (A) Function 1

Explanation

A default constructor takes no arguments, so FUN() (Function 1) is the default constructor. FUN(int) is parameterized, FUN(FUN&) is the copy constructor, and ~FUN() is the destructor.

Q7From DSSSB TGT Computer Science Practice Set 4
Which of the following is depicted from the flowchart shown below? Flowchart (top to bottom, one straight path): P=1000 → R=10 → T=2 → SI=P*R*T/100 → PRINT SI
  1. ASequencing
  2. BBranching
  3. CLooping
  4. DOverloading
Show answerHide answer

Correct answer: (A) Sequencing

Explanation

The flowchart runs straight from top to bottom with no decisions or loops, which is sequencing (sequential control flow).

Q8From DSSSB TGT Computer Science Practice Set 4
Run-time polymorphism is achieved by ______.
  1. AFriend function
  2. BVirtual function
  3. COperator overloading
  4. DFunction overloading
Show answerHide answer

Correct answer: (B) Virtual function

Explanation

Virtual functions give run-time (dynamic) polymorphism: the function called is chosen at run time from the object's actual type. Overloading is resolved at compile time.

Q9From DSSSB TGT Computer Science Practice Set 3
Additional information sent when an exception is thrown may be placed in ______.
  1. AThe throw keyword
  2. BThe function that caused the error
  3. CThe catch block
  4. DAn object of the exception class
Show answerHide answer

Correct answer: (D) An object of the exception class

Explanation

Corrected: the book's key says (c). The additional information is carried by the exception object that is thrown.

Q10From DSSSB TGT Computer Science Practice Set 3
An interface that provides I/O transfer of data directly to and from the memory unit and the peripheral, is termed as ______.
  1. ADDA
  2. BSerial Interface
  3. CBR
  4. DDMA
Show answerHide answer

Correct answer: (D) DMA

Explanation

DMA (Direct Memory Access) lets a peripheral transfer data directly to or from main memory without the CPU handling each word. The CPU only starts the transfer and is told when it ends.

Q11From DSSSB TGT Computer Science Practice Set 3
Every EJB class file has
  1. AOne accompanying interface and one XML file
  2. BOne accompanying interface and two XML files
  3. CTwo accompanying interfaces and one XML file
  4. DTwo accompanying interfaces and two XML files
Show answerHide answer

Correct answer: (C) Two accompanying interfaces and one XML file

Explanation

An EJB (EJB 2.x) bean class comes with two interfaces, the home interface and the remote (or component) interface, plus one XML deployment descriptor (ejb-jar.xml).

Q12From DSSSB TGT Computer Science Practice Set 3
In object-oriented programming, by wrapping up characteristics and behavior into one unit, we achieve
  1. AData abstraction
  2. BData encapsulation
  3. CData hiding
  4. DAll of these
Show answerHide answer

Correct answer: (B) Data encapsulation

Explanation

Encapsulation wraps data (characteristics) and the functions that act on it (behaviour) into one unit, the class. Data hiding and abstraction are results of this.

Q13From DSSSB TGT Computer Science Practice Set 2
This question is based upon the following class and code segment : class STOCK { float price ; public : STOCK( ) ; // Function 1 STOCK(float P) ; // Function 2 STOCK(STOCK &S) ; // Function 3 void INIT( ) ; // Function 4 void DISP( ) ; // Function 5 ~ STOCK( ) ; // Function 6 }; void main( ) { STOCK S2(10) ; // Statement 1 ______ ______ // Other Statements ______ } Which of the following declaration/statement will invoke the default constructor of the class - STOCK?
  1. ASTOCK S1(S2);
  2. BSTOCK S2;
  3. CSTOCK S1(20);
  4. DS2.INIT();
Show answerHide answer

Correct answer: (B) STOCK S2;

Explanation

Corrected: the book's key says (a), but STOCK S1(S2) calls the copy constructor. A declaration without arguments, like STOCK S2, invokes the default constructor.

Q14From DSSSB TGT Computer Science Practice Set 2
Name the type of Inheritance if Activity, Teacher and SUPW are C++ Classes and → denotes inheritance. Activity ↓ Teacher ↓ SUPW
  1. AMulti Level Inheritance
  2. BMultiple Inheritance
  3. CSingle Level Inheritance
  4. DHybrid Inheritance
Show answerHide answer

Correct answer: (A) Multi Level Inheritance

Explanation

Teacher inherits from Activity, and SUPW inherits from Teacher. A chain of single inheritance like this is multilevel inheritance.

Q15From DSSSB TGT Computer Science Practice Set 2
Name the top level object also known as the default object of the JavaScript Object Model.
  1. ADocument
  2. BBody
  3. CLocation
  4. DWindow
Show answerHide answer

Correct answer: (D) Window

Explanation

window is the top-level (global) object of the browser object model. document, location and others are its properties.

Q16From DSSSB TGT Computer Science Practice Set 2
Which one of the following most accurately describes "multiple inheritance" ?
  1. AWhen a child class has both an "is a" and a "has a" relationship with its parent class.
  2. BWhen two classes inherit from each other.
  3. CWhen a base class has two or more derived classes.
  4. DWhen a child class has two or more parent classes.
Show answerHide answer

Correct answer: (D) When a child class has two or more parent classes.

Explanation

Multiple inheritance means one derived (child) class inherits from two or more base (parent) classes.

Q17From DSSSB TGT Computer Science Practice Set 2
Which of the following is not a method of the window object in JavaScript ?
  1. Aopen( )
  2. Bclose( )
  3. Cname( )
  4. Dprompt( )
Show answerHide answer

Correct answer: (C) name( )

Explanation

open(), close() and prompt() are methods of the window object. name is a property (window.name), not a method.

Q18From DSSSB TGT Computer Science Practice Set 1
Which constructor will be called by the following lines of code.? (i) Student S1; (ii) Student S2 = S1
  1. AFirst copy constructor, then default constructor.
  2. BFirst default constructor, then copy constructor.
  3. CDefault constructors for both lines of code.
  4. DCopy constructors for both lines of code.
Show answerHide answer

Correct answer: (B) First default constructor, then copy constructor.

Explanation

Student S1; creates an object with no arguments, so the default constructor is called. Student S2 = S1; initialises a new object from an existing one, so the copy constructor is called.

Q19From DSSSB TGT Computer Science Practice Set 1
Assume the C++ definition : class circle : public point Which of the following is false?
  1. A'Point' is the base class and 'circle' is the derived class.
  2. BThe colon (:) in the header of class definition indicates inheritance.
  3. CThe keyword 'public' indicates type of inheritance.
  4. DAll the public and protected members of class 'circle' are inherited as public and protected members, respectively, into class 'point'.
Show answerHide answer

Correct answer: (D) All the public and protected members of class 'circle' are inherited as public and protected members, respectively, into class 'point'.

Explanation

Inheritance flows from the base class to the derived class. The public and protected members of point are inherited into circle, not the other way round, so statement D is false.

Q20From DSSSB TGT Computer Science Practice Set 1
The major goal of object – oriented programming is :
  1. ATop-down program development
  2. BSpeed
  3. CUser – interface
  4. DReuse
Show answerHide answer

Correct answer: (D) Reuse

Explanation

The main goal of OOP is reusability: classes, inheritance and polymorphism let existing code be reused and extended.

Q21From DSSSB TGT Computer Science Practice Set 1
In which case it is mandatory to provide a destructor in a class?
  1. AAlmost in every class
  2. BClass for which two or more than two objects will be created.
  3. CClass for which copy constructor is defined.
  4. DClass whose objects will be created dynamically.
Show answerHide answer

Correct answer: (D) Class whose objects will be created dynamically.

Explanation

A class whose objects are created dynamically, or that allocates memory with new, needs a destructor to free that memory. Otherwise the memory leaks.

Q22From DSSSB TGT Computer Science Practice Set 1
A scaling transformation changes the
  1. ASize of an object
  2. BLocation of an object
  3. CShape of an object
  4. DBoth (a) and (b)
Show answerHide answer

Correct answer: (A) Size of an object

Explanation

Scaling multiplies coordinates by scale factors, which changes the size of the object. Translation changes the location.

Q23From DSSSB TGT Computer Science Practice Set 1
OLE, A Microsoft's component document technology, means :
  1. AOverlay Linking and Exchange
  2. BOnline Linking and Embedding
  3. COpen Learning Exchange
  4. DObject Linking and Embedding
Show answerHide answer

Correct answer: (D) Object Linking and Embedding

Explanation

OLE is Object Linking and Embedding, Microsoft's technology for linking or embedding objects from one application in a document of another.

Q24DSSSB PGT Computer Science (Technical), 11 Jul 2021
Which component of the computer is used to resolve the difference between CPU and the peripheral device?
  1. AMemory unit
  2. BArithmetic Logic Unit
  3. CInterface unit
  4. DControl unit
Show answerHide answer

Correct answer: (C) Interface unit

Explanation

An interface unit sits between the CPU and a peripheral and resolves differences in speed, data format, signal values and timing between them.

Q25DSSSB PGT Computer Science (Technical), 11 Jul 2021
What is the function of data input command in I/O command?
  1. AActivate the peripheral and to inform it what to do
  2. BTo check status conditions in the interface and the peripheral
  3. CIt cause the interface to respond by transferring data from bus into one of its registers
  4. DIt cause the interface to respond by transferring data from one of its register to bus
Show answerHide answer

Correct answer: (D) It cause the interface to respond by transferring data from one of its register to bus

Explanation

On a data input command the interface takes the data received from the peripheral into its buffer register and places it from that register onto the data bus, so the CPU can read it.

Q26DSSSB PGT Computer Science (Technical), 11 Jul 2021
Which one of the following is correct regarding Programming Languages?
  1. AProcedural programming – Functions
  2. BObject-oriented programming – Objects
  3. CFunctional programming – Logical unit
  4. DLogical Programming – Function
Show answerHide answer

Correct answer: (B) Object-oriented programming – Objects

Explanation

Object-oriented programming is organised around objects. Procedural programming is built on procedures, functional programming on functions, and logic programming on facts and rules.

Q27DSSSB PGT Computer Science (Technical), 11 Jul 2021
In a modular programming approach problem is further divided into ________.
  1. AQuestion
  2. BSolution
  3. CModules
  4. DObject
Show answerHide answer

Correct answer: (C) Modules

Explanation

Modular programming breaks a problem into smaller, independent modules that are developed and tested separately.

Q28DSSSB PGT Computer Science (Technical), 11 Jul 2021
In Object Oriented Programming, when a new class created from an existing class using principle of inheritance, then the new class is known as ________.
  1. ANew class
  2. BChild class
  3. CMember class
  4. DDerived class
Show answerHide answer

Correct answer: (D) Derived class

Explanation

A class created from an existing class by inheritance is called a derived class (subclass). The existing class is the base class.

Q29DSSSB PGT Computer Science (Technical), 11 Jul 2021
Which of the following is NOT an object oriented feature?
  1. AInheritance
  2. BAbduction
  3. CAbstraction
  4. DPolymorphism
Show answerHide answer

Correct answer: (B) Abduction

Explanation

Inheritance, abstraction, polymorphism and encapsulation are OOP features. Abduction is a form of logical reasoning, not an OOP feature.

Q30DSSSB PGT Computer Science (Technical), 11 Jul 2021
Match the following. i. Overriding — A. Allows a function of operator to be given more then one definition ii. Over loading — B. A function that is called to deallocate memory iii. Destructor — C. The ability to change the definition of an inherited method
  1. Ai-A, ii-C, iii-B
  2. Bi-C, ii-B, iii-A
  3. Ci-C, ii-A, iii-B
  4. Di-B, ii-C, iii-A
Show answerHide answer

Correct answer: (C) i-C, ii-A, iii-B

Explanation

Overriding redefines an inherited method in a derived class, overloading gives one function or operator several definitions, and a destructor releases memory/resources when an object is destroyed.

Q31DSSSB PGT Computer Science (Technical), 11 Jul 2021
________ act as a interface between a domain expert and an expert system.
  1. ALanguage Editor
  2. BK editor
  3. CIntelligent editor
  4. DKnowledge Editor
Show answerHide answer

Correct answer: (C) Intelligent editor

Explanation

In expert systems, the intelligent (knowledge-acquisition) editor is the interface the domain expert or knowledge engineer uses to enter and refine the knowledge base.

Q32DSSSB PGT Computer Science (Technical), 11 Jul 2021
________ computing is a model in which components of a software system are shared among multiple computers.
  1. ADistributed
  2. BAbstraction
  3. CPrivate
  4. DSimulation
Show answerHide answer

Correct answer: (A) Distributed

Explanation

In distributed computing, the components of a software system are shared among multiple networked computers that work together.

Q33DSSSB PGT Computer Science (Technical), 11 Jul 2021
The syllabus of Environment studies for class III to V is woven around the 6 interconnected themes. Which of the following is/are among those themes? I. Shelter II. Water III. Food
  1. AI and III
  2. BII and III
  3. COnly III
  4. DI, II, and III
Show answerHide answer

Correct answer: (D) I, II, and III

Explanation

The NCERT EVS syllabus for classes III-V uses six themes: Family and Friends, Food, Shelter, Water, Travel, and Things We Make and Do. So all three are themes.

Q34DSSSB TGT Computer Science (Technical), 8 Aug 2021, Shift 2
There are three main concepts that any language needs to support to be an object-oriented language. Which of the following is one of them? I. Encapsulation II. Inheritance III. Polymorphism
  1. AI and II
  2. BII and III
  3. CI and III
  4. DI, II and III
Show answerHide answer

Correct answer: (D) I, II and III

Explanation

The three pillars of object-oriented programming are encapsulation, inheritance and polymorphism, so a language must support all three.

Q35DSSSB TGT Computer Science (Technical), 8 Aug 2021, Shift 2
Which of the following is a component of Decision Support System (DSS)? I. User interface II. Knowledge engine
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (C) Both I and II

Explanation

A DSS has a user interface for interacting with the user, plus a database and a model base or knowledge engine that does the analysis. Both are components.

Q36DSSSB TGT Computer Science (Technical), 8 Aug 2021, Shift 2
Which matrix represents rotation of an object by 30° about the origin?
  1. AR30 = [ 1/2 √3/2; √3/2 −1/2 ]
  2. BR30 = [ √3/2 −1/2; 1/2 √3/2 ]
  3. CR30 = [ −1/2 √3/2; √3/2 1/2 ]
  4. DR30 = [ √3/2 −1/2; √3/2 1/2 ]
Show answerHide answer

Correct answer: (B) R30 = [ √3/2 −1/2; 1/2 √3/2 ]

Explanation

The rotation matrix is [cosθ −sinθ; sinθ cosθ]. With cos30° = √3/2 and sin30° = 1/2, this gives [√3/2 −1/2; 1/2 √3/2].

Q37DSSSB TGT Computer Science (Technical), 7 Aug 2021, Shift 2
________ is used to transfer the data directly to main memory without using CPU.
  1. ADevice drive
  2. BInput/output interface
  3. CDMA controller
  4. DMemory address Register
Show answerHide answer

Correct answer: (C) DMA controller

Explanation

A DMA controller moves data directly between I/O devices and main memory without passing each word through the CPU.

Q38DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 3
Which of the following statement(s) is/are NOT correct? I. In case of multi-grade and multi-level situations, teaching learning materials provide vital help to the teachers for effective management of their class. II. Teaching learning materials are needed for effective self-learning.
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (D) Neither I nor II

Explanation

Both statements are correct: TLMs help teachers manage multi-grade, multi-level classes, and they support self-learning. So neither statement is incorrect.

Q39DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 1
________ converts a source code to object code.
  1. ACompiler
  2. BLinker
  3. CEditor
  4. DLoader
Show answerHide answer

Correct answer: (A) Compiler

Explanation

A compiler translates the whole source program into object (machine) code. A linker combines object files, and a loader places the program in memory.

Q40DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 1
What is the name of the virtual machine component of microsoft .NET Framework which manages the execution of .NET program?
  1. ACode level security
  2. BCross language class inheritance
  3. CCommon language runtime
  4. DCommon type system
Show answerHide answer

Correct answer: (C) Common language runtime

Explanation

The Common Language Runtime (CLR) is the .NET virtual machine: it loads and runs code, and handles JIT compilation, memory management and security.

Q41DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 1
'It is not always possible to bring real objects to the classroom'. Which of the following is/are the reason(s) behind the given statement? I. Size of the object II. Safety III. Cost
  1. AI, II and III
  2. BII and III
  3. COnly III
  4. DI and II
Show answerHide answer

Correct answer: (A) I, II and III

Explanation

Real objects may be too big or too small, unsafe to bring (dangerous animals, chemicals) or too costly, so size, safety and cost are all reasons.

Q42DSSSB TGT Computer Science (Technical), 1 Aug 2021, Shift 1
'If you are planning to teach the different states of India in class VI, then you need to know whether the students are well conversant in using the atlas'. This given statement is referred to which of the following phase(s) of Assessment For Learning? I. Formative Assessment II. Diagnostic Assessment
  1. AOnly I
  2. BOnly II
  3. CBoth I and II
  4. DNeither I nor II
Show answerHide answer

Correct answer: (B) Only II

Explanation

Checking whether students already have a prerequisite skill (using an atlas) before teaching a topic is diagnostic assessment of their prior knowledge.

Q43DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)
When solving a Sudoku puzzle using computational thinking, which step is the most critical for ensuring efficiency?
  1. AProblem decomposition
  2. BAbstraction
  3. CBrute force approach
  4. DPattern recognition
Show answerHide answer

Correct answer: (D) Pattern recognition

Explanation

Sudoku is solved efficiently by recognising patterns, such as which numbers are missing in rows, columns and boxes. This cuts down the possibilities far more than brute force.

Q44DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)
What is the output of the following JavaScript code? const obj = { name: "Alice" }; Object.defineProperty(obj, "age", { value: 25, writable: false }); obj.age = 30; console.log(obj.age);
  1. Aundefined
  2. BError: Cannot modify property
  3. C25
  4. D30
Show answerHide answer

Correct answer: (C) 25

Explanation

writable: false makes the age property read-only. In non-strict mode, obj.age = 30 is silently ignored, so 25 is printed. Strict mode would throw a TypeError.

Q45DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)
Which of the following is NOT true about a Histogram?
  1. ARectangles have bases on vertical axis.
  2. BIt consists of a set of rectangles.
  3. CAreas of the rectangles are proportional to class frequencies
  4. DThese rectangles represent the range of the data
Show answerHide answer

Correct answer: (A) Rectangles have bases on vertical axis.

Explanation

Statement A is false: the bases of a histogram's rectangles lie on the horizontal (x) axis, which shows the class intervals. Frequencies are on the vertical axis.

Q46DSSSB TGT Computer Science (Technical), 13 Sep 2025, Shift 3 (5:00 PM)
Which of the following is a privacy concern with Instant Messaging (IM) applications?
  1. AData security
  2. BBetter user interface
  3. CFree video calls
  4. DUnlimited messaging
Show answerHide answer

Correct answer: (A) Data security

Explanation

IM apps carry personal messages and data that can be intercepted, leaked or misused, so data security is a privacy concern.

Q47DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
Which of the following statements about the DOM (Document Object Model) in JavaScript is true regarding its interaction with HTML and JavaScript?
  1. AThe DOM only allows reading the HTML document but does not permit any changes or updates.
  2. BThe DOM allows JavaScript to directly modify the structure of the HTML document by manipulating its elements, attributes and content.
  3. CThe DOM is a static representation of the page and does not update dynamically when changes occur in the document.
  4. DThe DOM can only interact with text-based HTML documents and cannot modify styles or events.
Show answerHide answer

Correct answer: (B) The DOM allows JavaScript to directly modify the structure of the HTML document by manipulating its elements, attributes and content.

Explanation

The DOM is a live tree of the page. JavaScript can use it to add, remove or change elements, attributes, content, styles and events, and the page updates immediately.

Q48DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 3 (5:00 PM)
How does an output unit interface with the CPU?
  1. ABy executing programs
  2. BBy storing temporary data
  3. CBy converting binary data into human-readable form
  4. DBy fetching instructions from memory
Show answerHide answer

Correct answer: (C) By converting binary data into human-readable form

Explanation

An output unit takes the binary results from the CPU and converts them into a form people can understand, such as text on a screen, print or sound.

Q49DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 2 (1:00 PM)
Which method is used to loop through all the enumerable properties of an object in JavaScript?
  1. AObject.values()
  2. BforEach()
  3. Cfor...in
  4. DObject.keys()
Show answerHide answer

Correct answer: (C) for...in

Explanation

The for...in loop iterates over all enumerable property names (keys) of an object. Object.keys() and Object.values() only return arrays, and forEach is an array method.

Q50DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)
What does the below code snippet represent? myObject.doActivity();
  1. ACalling a method named doActivity on the object myObject
  2. BSending a message to the doActivity class
  3. CCreating an object myObject
  4. DSending a message to the child class of myObject
Show answerHide answer

Correct answer: (A) Calling a method named doActivity on the object myObject

Explanation

The dot operator calls the method doActivity() on the object myObject (in OOP terms, sends the message doActivity to that object).

How to use these DSSSB TGT / PGT Computer Science questions

Every question here was asked in a real DSSSB TGT / PGT paper; the paper and shift are shown on the card, and the number opens the question on its own page. Try each one before tapping Show answer, then attempt the full DSSSB TGT / PGT papers as timed tests to check your speed under exam conditions.

More DSSSB TGT / PGT subjects