CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

Similar documents
CS/B.TECH/CSE(OLD)/SEM-6/CS-605/2012 OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

OBJECT ORIENTED PROGRAMMING TYm. Allotted : 3 Hours Full Marks: 70

B2.52-R3: INTRODUCTION TO OBJECT ORIENTATED PROGRAMMING THROUGH JAVA

15CS45 : OBJECT ORIENTED CONCEPTS

1 Shyam sir JAVA Notes

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Java Inheritance. Written by John Bell for CS 342, Spring Based on chapter 6 of Learning Java by Niemeyer & Leuck, and other sources.

COP 3330 Final Exam Review

OOPs Concepts. 1. Data Hiding 2. Encapsulation 3. Abstraction 4. Is-A Relationship 5. Method Signature 6. Polymorphism 7. Constructors 8.

Class, Variable, Constructor, Object, Method Questions

Programming overview

1 Method Signatures and Overloading (3 minutes, 2 points)

PESIT Bangalore South Campus

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Selected Questions from by Nageshwara Rao

Argument Passing All primitive data types (int etc.) are passed by value and all reference types (arrays, strings, objects) are used through refs.

STRUCTURING OF PROGRAM

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA

Introduction to Programming Using Java (98-388)

CSC207H: Software Design. Java + OOP. CSC207 Winter 2018

JAVA MOCK TEST JAVA MOCK TEST IV

Midterm Exam CS 251, Intermediate Programming March 6, 2015

CONTENTS. Chapter 1 Getting Started with Java SE 6 1. Chapter 2 Exploring Variables, Data Types, Operators and Arrays 13

CS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University

Name of subject: JAVA PROGRAMMING Subject code: Semester: V ASSIGNMENT 1

CS260 Intro to Java & Android 03.Java Language Basics

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA

Declarations and Access Control SCJP tips

CSC Java Programming, Fall Java Data Types and Control Constructs

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Object-oriented basics. Object Class vs object Inheritance Overloading Interface

Abstract Classes Interfaces CSCI 201 Principles of Software Development

Abstract Classes Interfaces CSCI 201 Principles of Software Development

CS Internet programming Unit- I Part - A 1 Define Java. 2. What is a Class? 3. What is an Object? 4. What is an Instance?

HAS-A Relationship. Association is a relationship where all objects have their own lifecycle and there is no owner.

JAVA MOCK TEST JAVA MOCK TEST III

Fundamentals of Object Oriented Programming


Character Stream : It provides a convenient means for handling input and output of characters.

More on Exception Handling

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

The Java language has a wide variety of modifiers, including the following:

1 OBJECT-ORIENTED PROGRAMMING 1

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Outline. Java Models for variables Types and type checking, type safety Interpretation vs. compilation. Reasoning about code. CSCI 2600 Spring

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Inheritance (Part 5) Odds and ends

Lecture 4: Extending Classes. Concept

THE CATHOLIC UNIVERSITY OF EASTERN AFRICA A. M. E. C. E. A

Introduction to Java. Handout-1d. cs402 - Spring

Inheritance. Inheritance allows the following two changes in derived class: 1. add new members; 2. override existing (in base class) methods.

VALLIAMMAI ENGINEERING COLLEGE

Types, Values and Variables (Chapter 4, JLS)

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

1. Java is a... language. A. moderate typed B. strogly typed C. weakly typed D. none of these. Answer: B

Inheritance. Inheritance Reserved word protected Reserved word super Overriding methods Class Hierarchies Reading for this lecture: L&L

Administrivia. Java Review. Objects and Variables. Demo. Example. Example: Assignments

Notes on Java Programming IST JAV 2012 S. Frénot

Programming II (CS300)

Midterm Exam CS 251, Intermediate Programming October 8, 2014

The Sun s Java Certification and its Possible Role in the Joint Teaching Material

Class definition. complete definition. public public class abstract no instance can be created final class cannot be extended

Java Identifiers, Data Types & Variables

Full file at Chapter 2 - Inheritance and Exception Handling

Some Interview Question-Answers on Java JAVA. dfghjklzxcvbnmqwertyuiopasdfghjklzx 1/10/2013. cvbnmqwertyuiopasdfghjklzxcvbnmq.

1.Which four options describe the correct default values for array elements of the types indicated?

20 Most Important Java Programming Interview Questions. Powered by

BSc. (Hons.) Software Engineering. Examinations for / Semester 2

CSC207H: Software Design. Java + OOP. CSC207 Winter 2018

A Third Look At Java. Chapter Seventeen Modern Programming Languages, 2nd ed. 1

CS506 Web Design & Development Final Term Solved MCQs with Reference

Get Unique study materials from

Polymorphism CSCI 201 Principles of Software Development

More on Exception Handling

Chapter 5. Inheritance

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003

(A) 99 ** (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution

Introduction to Java

Java Fundamentals p. 1 The Origins of Java p. 2 How Java Relates to C and C++ p. 3 How Java Relates to C# p. 4 Java's Contribution to the Internet p.

Programming in Java, 2e Sachin Malhotra Saurabh Choudhary

Administration. Exceptions. Leftovers. Agenda. When Things Go Wrong. Handling Errors. CS 99 Summer 2000 Michael Clarkson Lecture 11

AP Computer Science Chapter 10 Implementing and Using Classes Study Guide

Review: Object Diagrams for Inheritance. Type Conformance. Inheritance Structures. Car. Vehicle. Truck. Vehicle. conforms to Object

Java Bytecode (binary file)

Midterm Exam CS 251, Intermediate Programming March 12, 2014

Birkbeck (University of London) Software and Programming 1 In-class Test Mar Answer ALL Questions

JAVA MOCK TEST JAVA MOCK TEST II

Programming II (CS300)

Java Class Design. Eugeny Berkunsky, Computer Science dept., National University of Shipbuilding

Exercise Session Week 8

Overriding המחלקה למדעי המחשב עזאם מרעי אוניברסיטת בן-גוריון

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING

Software 1 with Java. Initialization. Initialization. Initialization. Pass by Value. Initialization. Recitation No. 11 (Summary)

Crash Course in Java. Why Java? Java notes for C++ programmers. Network Programming in Java is very different than in C/C++

Chapter 5 Object-Oriented Programming

Polymorphism. return a.doublevalue() + b.doublevalue();

CS 162, Lecture 25: Exam II Review. 30 May 2018

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

Assumptions. History

Transcription:

CS/B.TECH/CSE(New)/SEM-5/CS-504D/2013-14 2013 OBJECT ORIENTED PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers in their own words as far as practicable. GROUP A (Multiple Choice Type Question) 1. Choose the correct alternatives for the following: 10 x 1 = 10 i) Which three form part of correct array declaration? 1. public int a[ ] 2. static int [ ] a 3. public [ ] int a 4. private int a[3] 5. private int [3] a[ ] 6. public final int [ ] a a) 1, 3, 4 b) 2, 4, 5 c) 1, 2, 6 d) 2, 5, 6 ii) public class Test What is the prototype of the default constructor? a) Test ( ) b) Test(void) c) public Test ( ) d) public Test (void)

iii) What is the most restrictive access modifier that will allow members of one class to have access to members of another class in the same package? a) public b) abstract c) protected d) synchronized e) default access. iv) Which cause a compiler error? a) int [ ] scores = 3, 5, 7; b) int [ ] [ ] scores = 2, 7, 6, 9, 3, 45; c) String cats[ ] = Fluffy, Spot, Zeus ; d) Boolean results [ ] = new Boolean [ ] true, false, true; e) Integer results[ ] = new Integer(3), new Integer(5), new Integer(8) ; v) Which three are valid method signatures in an interface? 1. private int getarea( ); 2. public float getvol(float x); 3. public void main ( String[ ] args); 4. public static void main(string[ ] args); 5. Boolean setflag (Boolean[ ] test); a) 1 and 2 b) 2, 3, and 5 c) 3, 4, and 5 d) 2 and 4 vi) You want a class to have access to members of another class in the same package. Which is the most restrictive access that accomplishes this objective? a) public b) private c) protected d) default access.

vii) class A protected int method 1 (int a, int b) return 0; Which is valid in a class that extends class A a) public int method 1 (int a, int b) return 0; b) private int method 1 (int a, int b) return 0; c) public short method 1 (int a, int b) return 0; d) static protected int method 1 (int a, int b) return 0;. viii) Which is a valid declaration within an interface? a) public static short stop = 23; b) protected short stop = 23; c) transient short stop = 23; d) final void madness (short stop); ix) Which two cause a compiler error? 1. float[ ] f = new float (3); 2. float f2[ ] = new float [ ]; 3. float [ ]f1 = new float [3]; 4. float f3 [ ] = new float [3]; 5. float f5 [ ] = 1.0f, 2.0f, 2.0f; a) 2, 4 b) 3, 5 c) 4, 5 d) 1, 2

x) What is the narrowest valid return Type for method A in line 3? public return Type method A (byte x, double y)/* Line 3 */ return (long)x/y * 2; a) int b) byte c) long d) double. GROUP B (Short Answer Type Questions) Answer any three of the following. 3 x 5 = 15 2. What are the two methods to create treads? Compare them. Explain them with an example Java program.2+3 3. Explain Function overloading with an example. 4. What is class? How does it accomplish data hiding?2+3 5. What is constructor? What does the finalize method do?2+3 6. What is delegation model in Java Applet? GROUP C (Long Answer Type Questions) Answer any three of the following. 3 x 15 = 45 7. Discuss the differences between the following: i) throw and throws clause ii) iii) iv) Abstract classes and interfaces Applet and Application programming in java Method overloading and method overriding v) final and finally.

8. a) Discuss the garbage collection procedure in java. What is the difference between processes and threads? 2+2 b) Explain how user defined exception objects can be created and thrown. 5 c) Explain how parallel child threads can be created from the parent thread? Give programme code to support your answer. 6 9. a) Discuss the Applet life Cycle methods with their functionalities? 5 b) Explain the parameter passing mechanism using an applet programme? 5 c) What do you mean by Dynamic Method Dispatch? What is the difference between default access specifier and public access specifier? 3+2 10. a) What will be the output of the following programme code? Explain your answer. Class Avoid show( ) System.out.println( Inside show of A ); class B extends A void show( ) super.show( ); System.out.printn( Inside show of B ); class demo public static void main(string args[ ]) A a1 = new B( ); a1.show( ); 4 b) Discuss the following terms: 3 2 i) Association ii) iii) Aggregation Meta-class. c) Explain whether java supports multiple inheritance or not. What do you mean by JVM? 3+2

11. a) Discuss the role of the following methods in java: 5 2 i) public void join( ) throws Interrupted Exception ii) getdocumentbase ( ) iii) getcodebase ( ) iv) String int length ( ) v) Boolean equals ( String str) b) Discuss the Exception class hierarchy starting from the Throwable class. Explain the differences between the private and protected access specifier in java. 3+2 ==========