object oriented programming quiz 2, Quizzes of Object Oriented Programming

this document will help student and teacher to prepare quiz of object oriented programming

Typology: Quizzes

2019/2020

Uploaded on 10/25/2020

mehwish-mehmood
mehwish-mehmood 🇵🇰

2.3

(3)

6 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Name: ______________________________Roll#._______________________
1. Identify which of the following items do you think should. [1 Mark]
be a super class or sub class
be an object
if an object that identify its class
Or incase if the item could either be a class or an object then explain why
2. What mechanism we use if we want to call an overloaded constructor within a class. [1
Mark]
3. Draw the every state of memory if below code are executed. [1 Mark]
Course crs=new course();
Course crs1=crs;
4. What is roster array explain with example. [1 Mark]
5. Discuss the rules of constructor? [1 Mark]
6. What is difference between class and object? [1 Mark]
7. Which keyword is used to create object? [1 Mark]
8. What is the output of the following program. [1 Mark]
public class Test {
public int x=0;
public void Test() {
x=7;
}
public static void main(String[] args) {
Test t = new Test();
SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY
BIOINFORMATICS DEPARTMENT
FALL 2019
OBJECT ORIENTED PROGRAMMING (CS-224)
Quiz 2
Semester: VI Batch: 2018
Max Time: 15 mins Max Marks: 10
Instructions:
Attempt all questions
Karachi University, Student, teacher, vehicle, Car, Board Game, University, BS Student , Game,
Chess, Mazda Car, Object Oriented Programming, Aircraft , PIA, Ali Ahmed, Sir Adil, Cricket,
Course, Web Engineering, Ms Student, Air line Company, emirates
pf2

Partial preview of the text

Download object oriented programming quiz 2 and more Quizzes Object Oriented Programming in PDF only on Docsity!

Name: ______________________________Roll#._______________________

  1. Identify which of the following items do you think should. [1 Mark]  be a super class or sub class  be an object  if an object that identify its class  Or incase if the item could either be a class or an object then explain why
  2. What mechanism we use if we want to call an overloaded constructor within a class. [ Mark]
  3. Draw the every state of memory if below code are executed. [1 Mark] Course crs=new course(); Course crs1=crs;
  4. What is roster array explain with example. [1 Mark]
  5. Discuss the rules of constructor? [1 Mark]
  6. What is difference between class and object? [1 Mark]
  7. Which keyword is used to create object? [1 Mark]
  8. What is the output of the following program. [1 Mark] public class Test { public int x=0; public void Test() { x=7; } public static void main(String[] args) { Test t = new Test(); SIR SYED UNIVERSITY OF ENGINEERING & TECHNOLOGY BIOINFORMATICS DEPARTMENT FALL 2019 OBJECT ORIENTED PROGRAMMING (CS-224) Quiz 2 Semester: VI Batch: 2018 Max Time: 15 mins Max Marks: 10 Instructions:  Attempt all questions  Karachi University, Student, teacher, vehicle, Car, Board Game, University, BS Student , Game, Chess, Mazda Car, Object Oriented Programming, Aircraft , PIA, Ali Ahmed, Sir Adil, Cricket, Course, Web Engineering, Ms Student, Air line Company, emirates

System.out.println(t.x); } }


  1. What is the output of the following program? [1 Mark] Public class A { Public static int doStuff(double x, double y) { Return (int)(x/y); } Public static void main(){ Float x = 6.0; int y = 11; x = A.doStuff(y,x); System.out.print("x="+x+", y="+y); } } (a)x=1,y= (b)This program does not compile (c)x=6.0,y= (d)x=1.0,y=
  2. What is the major problem of this constructor? Correct the problem. [1 Mark] public void point(int initialX, int initialY){ int x = initialX; int y = initialY; }





GOOD LUCK