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

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

1 Shyam sir JAVA Notes

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

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

15CS45 : OBJECT ORIENTED CONCEPTS

Introduction to Programming Using Java (98-388)

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Index COPYRIGHTED MATERIAL

Java Intro 3. Java Intro 3. Class Libraries and the Java API. Outline

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)

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

Computational Expression

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

Lec 3. Compilers, Debugging, Hello World, and Variables

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

CS260 Intro to Java & Android 03.Java Language Basics

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Contents. iii Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services August 1998, Revision B

Introduction to Java

Core JAVA Training Syllabus FEE: RS. 8000/-

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

CS 231 Data Structures and Algorithms, Fall 2016

Programming overview

Java Overview An introduction to the Java Programming Language

VARIABLES AND TYPES CITS1001

1 OBJECT-ORIENTED PROGRAMMING 1

CT 229 Fundamentals of Java Syntax

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University

JAVA MOCK TEST JAVA MOCK TEST III

Class Libraries and Packages

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

Points To Remember for SCJP

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

In this lab we will practice creating, throwing and handling exceptions.

cis20.1 design and implementation of software applications I fall 2007 lecture # I.2 topics: introduction to java, part 1

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

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1

Programming. Syntax and Semantics

CS 11 java track: lecture 1

A3-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH 'C' LANGUAGE

Java Object Oriented Design. CSC207 Fall 2014

CS11 Java. Fall Lecture 1

Chapter 6 Introduction to Defining Classes

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.

Chapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics

PROGRAMMING FUNDAMENTALS

PESIT Bangalore South Campus

CSC Java Programming, Fall Java Data Types and Control Constructs

SELF-STUDY. Glossary

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

CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1

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

A6-R3: DATA STRUCTURE THROUGH C LANGUAGE

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

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

12/22/11. Java How to Program, 9/e. public must be stored in a file that has the same name as the class and ends with the.java file-name extension.

[Course Overview] After completing this module you are ready to: Develop Desktop applications, Networking & Multi-threaded programs in java.

Array. Prepared By - Rifat Shahriyar

JAVA WRAPPER CLASSES

M1-R4: IT TOOLS AND BUSINESS SYSTEMS

Chapter 2: Using Data

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Introduction. Assessment Test. Part I The Programmer s Exam 1

Java Programming Course Overview. Duration: 35 hours. Price: $900

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

Java Interview Questions

3. Java - Language Constructs I

Java Fundamentals (II)

Java 2 Programmer Exam Cram 2

Full file at

COE318 Lecture Notes Week 3 (Week of Sept 17, 2012)

Java Programming. Manuel Oriol, March 22nd, 2007

Selected Questions from by Nageshwara Rao

Compaq Interview Questions And Answers

CS506 Web Design & Development Final Term Solved MCQs with Reference

STRUCTURING OF PROGRAM

Introduction to. Android Saturday. Yanqiao ZHU Google Camp School of Software Engineering, Tongji University. In courtesy of The Java Tutorials

Assumptions. History

Java 1.8 Programming

Basics of Java Programming

5/23/2015. Core Java Syllabus. VikRam ShaRma

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Chapter 02: Using Data

Declarations and Access Control SCJP tips

A Quick Tour p. 1 Getting Started p. 1 Variables p. 3 Comments in Code p. 6 Named Constants p. 6 Unicode Characters p. 8 Flow of Control p.

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

SCHEME OF COURSE WORK

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Time : 3 hours. Full Marks : 75. Own words as far as practicable. The questions are of equal value. Answer any five questions.

Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7)

Java Notes. J Pickering Department of Computer Science The University of York Heslington York YO10 5DD UK

1 Epic Test Review 2 Epic Test Review 3 Epic Test Review 4. Epic Test Review 5 Epic Test Review 6 Epic Test Review 7 Epic Test Review 8

Software and Programming 1

Type of Classes Nested Classes Inner Classes Local and Anonymous Inner Classes

Java: introduction to object-oriented features

The program compiles properly but at runtime it will give "Main method not public." message.

Transcription:

B2.52-R3: INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING THROUGH JAVA NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be answered in the TEAR-OFF ANSWER SHEET only, attached to the question paper, as per the instructions contained therein. PART ONE is NOT to be answered in the answer book. 3. Maximum time allotted for PART ONE is ONE HOUR. Answer book for PART TWO will be supplied at the table when the answer sheet for PART ONE is returned. However, candidates, who complete PART ONE earlier than one hour, can collect the answer book for PART TWO immediately after handing over the answer sheet for PART ONE. TOTAL TIME: 3 HOURS TOTAL MARKS: 100 (PART ONE 40; PART TWO 60) PART ONE (Answer all the questions) 1. Each question below gives a multiple choice of answers. Choose the most appropriate one and enter in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) 1.1 A colored image can be converted into a grayscale by using A) CropImageFilter B) RGBImageFilter C) ImageConsumer A) ImageProducer 1.2 void printout( int I ) { if (I==0) return; for(int i=i;i>0;i--) { System.out.println("Line " + i); printout(i-1); What value should be passed to the method printout, shown above, so that ten lines will be printed? A) 2 B) 3 C) 4 D) 5 1.3 If not assigned a value, a variable of type char has which default value? A) '\u0001' B) '\uffff' C) " " (space) D) '\u0000' B2.52-R3 Page 1 of 6 January, 2009

1.4 When is an object eligible for garbage collection? A) When an object becomes unreachable by any code B) When the finalize method is called on the object C) When an object goes out of scope D) When the system runs out of virtual memory 1.5 What would be the output from the following code? public class Thread373 implements Runnable { boolean flag = false; public void start() { if (!flag) System.out.println("Hello World"); public static void main(string[] args) { Thread373 t373 = new Thread373(); t373.start(); A) Compilation succeeds, Hello World is printed out. B) Compilation succeeds, nothing is printed out. C) Compilation fails. D) Execute with warnings. 1.6 If you create a TextField with a constructor to set it to occupy 5 columns, what difference will it make if you use it with a proportional font (i.e. Times Roman) or a fixed pitch typewriter style font (Courier). A) With a fixed font, you will see 5 characters, with a proportional it will depend on the width of the characters. B) With a fixed font, you will see 5 characters; with a proportional it will cause the field to expand to fit the text. C) The columns setting do not affect the number of characters displayed. D) Both will show exactly 5 characters. 1.7 A class needs to be created that will store unique object elements. The elements need not be sorted but they must be unique. What interface might be most suitable to meet this need? A) Set B) List C) Map D) Vector 1.8 Using the File class the task can be performed is A) Change the current directory B) Return the name of the parent directory C) Delete a file D) Finds whether a file contains text or binary information B2.52-R3 Page 2 of 6 January, 2009

1.9 What will be output by the following line? System.out.println(Math.floor(-2.1)); A) -2 B) 2.0 C) -3 D) -3.0 1.10 Which of the following wrapper classes can not take a String in constructor? A) Boolean B) Integer C) Double D) Character 2. Each statement below is either TRUE or FALSE. Choose the most appropriate one and ENTER in the tear-off sheet attached to the question paper, following instructions therein. (1 x 10) 2.1 An instance of class java.awt.panel cannot be added to another instance of the same class. 2.2 Constructor methods allow class objects to be created with fields initialized to values as determined by the methods' parameters. 2.3 The modulus operator (%) in Java can be used only with variables of integer type. 2.4 A static method can refer to any instance variables of the class. 2.5 javac and java command are case sensitive. 2.6 If getparameter method of an instance of java.applet, Applet class returns null, then an exception of type a NullPointerException is thrown. 2.7 Multicasting means broadcasting DatagramPackets to every host on the Internet. 2.8 A method's name in java can be an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign "$", or the underscore character "_". 2.9 null may be assigned to any variable, except the variables of primitive types. 2.10 If multiple listeners are added to a component, the events will be processed for all but with no guarantee in the order. B2.52-R3 Page 3 of 6 January, 2009

3. Match words and phrases in column X with the closest related meaning/ word(s)/phrase(s) in column Y. Enter your selection in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) X Y 3.1 In java.awt package the setbackground() method is part of the A. System class 3.2 Specifying a port that is an invalid port number when creating B. java.lang ServerSocket results in a 3.3 The current security manager is set by the C. super setsecuritymanager method is of 3.4 The hierarchy of exception classes commence from Throwable D. packages class which is the base class in 3.5 The API is a large collection of ready-made software E. Component class components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as 3.6 If your method overrides one of its superclass's methods, you F. interface can invoke the overridden method through the use of the keyword 3.7 Use long data type when you need a range of values wider G. BindException. than those provided by 3.8 A collection of methods with no implementation is called a(n) H. int 3.9 Byte code is an intermediary language between Java source I. float and the 3.10 Class that is used to create multicast socket is J. host system K. this L. DatagramSocket M. the host system N java.util B2.52-R3 Page 4 of 6 January, 2009

4. Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list below. Enter your choice in the tear-off answer sheet attached to the question paper, following instructions therein. (1 x 10) A. ResultSet B. static C. Properties D. Statement E. abstract F. reference G. interface H. anchor I. valueof J. this K. (minus) L. Locale 4.1 The System class provides access to the native operating system's environment through the use of methods. 4.2 Class String provides static method that takes an argument of any type and converts the argument to a String object. 4.3 The flag causes output to be left justified in a field. 4.4 A(n) object is used to submit a query to a database. 4.5 The GridBagConraints s instance variable is set to CENTER, by default for component. 4.6 The most common reason for using the keyword is because a field is shadowed by a method or constructor parameter. 4.7 In the Java programming language, a(n) is a reference type, similar to a class that can contain only constants, method signatures, and nested types. 4.8 The Java platform itself uses a(n) object to maintain its own configuration. 4.9 A(n) object is an identifier for a particular combination of language and region. 4.10 Assignment to an interface type variable from a(n) type, implements that interface is possible without a cast. B2.52-R3 Page 5 of 6 January, 2009

PART TWO (Answer any FOUR questions) 5. a) Write a program to print factorial of a given number. b) The Java programming language allows you to define a class within another class. Explain nested classes in java. (10+5) 6. a) An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program's instructions. Explain different kinds of exceptions in java. b) Explain various steps to create native methods in java. c) Real-world objects share two characteristics: They all have state and behaviour. Which are the benefits of Bundling code into individual software objects? (3+8+4) 7. a) Illustrate constructors and destructors with examples. b) Write a java program to implement Queue. c) The URL class provides several methods that let you query URL objects. Explain these methods. (2+6+7) 8. a) JDBC interfaces can be used to find out the information about database and table. Explain methods of ResultSetMetaData interface. b) In java classes, constructors, methods and fields are regulated using access modifiers. What is access modifier and explain various access modifiers available in java. c) Explain, how inter thread communication is possible in java multithreaded environments? (7+5+3) 9. Answer any three of the following: a) Distinguish between abstract class and interface illustrate with example. b) Explain Write once and run anywhere nature of Java. c) The Java Archive (JAR) file format enables you to bundle multiple files into a single archive file. What are the benefits of making JAR file? d) Each top-level container in swing has a content pane that contains (directly or indirectly) the visible components in that top-level container s GUI. Explain different type of panes. (3x5) B2.52-R3 Page 6 of 6 January, 2009