(2½ hours) Total Marks: 75

Similar documents
Introduction to Programming Using Java (98-388)

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

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

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.

CSC Java Programming, Fall Java Data Types and Control Constructs

15CS45 : OBJECT ORIENTED CONCEPTS

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

Core JAVA Training Syllabus FEE: RS. 8000/-

Index COPYRIGHTED MATERIAL

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

Object Oriented Programming with Java. Unit-1

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

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

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Govt. of Karnataka, Department of Technical Education Diploma in Information Science & Engineering. Fifth Semester

PROGRAMMING FUNDAMENTALS

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

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

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

PESIT Bangalore South Campus

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Table of Contents. Chapter 1 Getting Started with Java SE 7 1. Chapter 2 Exploring Class Members in Java 15. iii. Introduction of Java SE 7...

Java 1.8 Programming

Java Primer 1: Types, Classes and Operators

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

CS11 Java. Fall Lecture 1

Java Programming. MSc Induction Tutorials Stefan Stafrace PhD Student Department of Computing

CMSC 331 Second Midterm Exam


S.E. Sem. III [CMPN] Object Oriented Programming Methodology

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

Mobile MOUSe JAVA2 FOR PROGRAMMERS ONLINE COURSE OUTLINE

Objects and Iterators

VALLIAMMAI ENGINEERING COLLEGE

Sri Vidya College of Engineering & Technology

A- Core Java Audience Prerequisites Approach Objectives 1. Introduction

CSE 142 Su 04 Computer Programming 1 - Java. Objects

C++ Important Questions with Answers

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

Get Unique study materials from

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM)

Object-Oriented Programming

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

WA1278 Introduction to Java Using Eclipse

1 Shyam sir JAVA Notes

Exam 1 Prep. Dr. Demetrios Glinos University of Central Florida. COP3330 Object Oriented Programming

DOWNLOAD PDF CORE JAVA APTITUDE QUESTIONS AND ANSWERS

SRM ARTS AND SCIENCE COLLEGE SRM NAGAR, KATTANKULATHUR

CS 251 Intermediate Programming Methods and Classes

CS 251 Intermediate Programming Methods and More

SRM INSTITUTE OF SCIENCE & TECHNOLOGY Faculty of Science and Humanities Department of Computer Science UNIT I - INTRODUCTION TO JAVA

Operators and Expressions

NOOTAN PADIA ASSIST. PROF. MEFGI, RAJKOT.

DEPARTMENT OF INFORMATION TECHNOLOGY

Pace University. Fundamental Concepts of CS121 1

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

SCHEME OF COURSE WORK

STRUCTURING OF PROGRAM

Java for Non Majors Spring 2018

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

JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015

Hierarchical inheritance: Contains one base class and multiple derived classes of the same base class.

Core Java Syllabus. Overview

CS-140 Fall 2017 Test 2 Version A Nov. 29, 2017

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

Course Outline. Introduction to java

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

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)

Core Java SYLLABUS COVERAGE SYLLABUS IN DETAILS

C++ (Non for C Programmer) (BT307) 40 Hours

CSC 1214: Object-Oriented Programming

Object Oriented Programming: In this course we began an introduction to programming from an object-oriented approach.

Brief Summary of Java

Discover how to get up and running with the Java Development Environment and with the Eclipse IDE to create Java programs.

Java Overview An introduction to the Java Programming Language

Java Programming with Eclipse

Computer Science II (20082) Week 1: Review and Inheritance

( &% class MyClass { }

Java: introduction to object-oriented features

S.No Question Blooms Level Course Outcome UNIT I. Programming Language Syntax and semantics

UNIT 3 ARRAYS, RECURSION, AND COMPLEXITY CHAPTER 11 CLASSES CONTINUED

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

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY JAVA

Language Reference Manual

Java Training JAVA. Introduction of Java

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

CS506 Web Design & Development Final Term Solved MCQs with Reference

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

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

Compaq Interview Questions And Answers

JAVA WRAPPER CLASSES

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

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

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

Interview Questions of C++

GUJARAT TECHNOLOGICAL UNIVERSITY

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

CORE JAVA TRAINING COURSE CONTENT

Standard. Number of Correlations

Transcription:

(2½ hours) Total Marks: 75 N. B.: (1) All questions are compulsory. (2) Makesuitable assumptions wherever necessary and state the assumptions mad (3) Answers to the same question must be written together. (4) Numbers to the right indicate marks. (5) Draw neat labeled diagrams wherever necessary. (6) Use of Non-programmable calculators is allowe Note : This answer key is an outline for the distribution of marks and brief concept of the answer. The actual explanation can be taken from any prescribed text book. For Questions like 2e, 3d, 3f, These statements have to be explained in two aspects. One is the syntax and the other one is their functionality and concept. The aim is to test whether the student can interpret random and short code snippets. 1. Attempt any three of the following: 15 Write a short notes on java s architecture and its components. Ans ) Explain JVM (3m) Explain jdk, jre and the association between them (2m) Write in detail about different types of operators in java, category-wise quoting their functionality, operands and return typ Give one example statement for each. Ans) Minimum 3 different categories have to be explained ( arithmetic, relational, logical, bitwise, others ) Eg : Arithmetic / Addition / + / operands : numeric / return type : numeric / Eg: k=a+b; Relational /equals to / == / return type : boolean value What are the primitive data types in java? Briefly explain their size, range and other details. Ans ) quoting all types (integer types, float types, char and boolean) (1m) Each one s size and range (4m) Explain the terms : narrowing, widening, instantiation, auto boxing Ans) : Narrowing : when a larger data type is assigned to a smaller one then type casting is require This conversion is known as narrowing. The two types must be compatible for conversion. (2m) Widening : when a smaller data type is assigned to a larger one then automatic conversion takes place in jav This is known as widening. The two types must be compatible for conversion.(1m) Instantiation : creating an instance of a class. i., object (1m) Auto boxing : The process by which primitive type is automatically encapsulated into its equivalent type wrapper whenever an object of that type is require (2m) Briefly explain : (i) Type annotations (2m) (ii) Lambda expressions.(3m) Ans) Lambda expressions are introduced in Java 8. Lambda expression facilitates functional programming, and simplifies the development a lot.the important characteristics of a lambda expression. Optional type declaration, Optional parenthesis around parameter,

Optional curly braces, Optional return keyword Briefly explain the salient features of jav Ans ) brief explanation of any 5 features: ( few are given below) Robust and secure Platform-independent Portable Simple, small and familiar Compiled and interpreted Multithreaded and interactive Dynamic and extensible High performance 2. Attempt any three of the following: 15 Write a short notes on access specifiers in jav Ans ) Explain public, private, protected and default access specifiers behavior w.r.t individual class and w.r.t inheritance as well. (1m for each specifier ) Tabular representation is preferable along with the explanation. (1m) Write a comparative note on overloading and overriding in jav Ans) definition of overloading, overriding (1m) Explanation of functionality and difference (1m) One code example for each(2m) Explain the functionality of different types of iterative statements in java, using suitable examples. Ans) Explain the functionality of for & for each, while and do-while statements (3m) Example code segments (2m) Explain : (i) Varargs (ii) this (iii) super Ans) definitions : varargs(1m), this (2m) and super(2m) Demonstrate the behavior of static members in java using a suitable exampl Ans) explaining static data member s behavior (2m) Explaining static method s behavior (1m) A short example code (1m) (i) Rectangle rec = new Rectangle(a,b); The above statement represents instatiation of an object using a parameterized constructor. Here, Rectangle is a class name and rec is an object of class being create new is the keyword for instantiation and a,b are the arguments sent for the constructor. (2m) (ii) break out; This is the labeled jump statement. Here break is the keyword and out is the label nam this statement shifts the control flow to the statement to the statement which is labeled as out.(1m) (iii)public static void main(string ag[]) {.. } The above code line represents brief outline of the main method in jav Here the access specifier public indicates says that it is accessible to all classes. Keyword static indicates that it belogs to the entire class but not of any objects of that class. main() must always be declared as stati Void indicates that it doesn t retuen any valu String ag[] indicates the commandline parameters array. (2m)

3. Attempt any three of the following: 15 Write a comparative note on abstract classes and interfaces in jav Ans ) similarities and differences (4m) Define in java code (1m) Quote the different kinds of inheritance available in jav Explain them using suitable code segments. Ans) explain single, Multi-level, hierarchical with short block diagrams. (3m) Short code segments as examples (2m) Explain the terms/keywords : final, finally, finalize() Explain the below given code and the concept(s) it represents : 1) Shape gen = new Shape(); 2) Rect r = new Rect(); Circ c = new Circ(); 3) int k = Integer.parseInt(args[0]) ; // reading a number from commandline 4) if (k==1) gen = r; else gen=c; 5) gen.showdata(); Ans) The given code reflects the concept of dynamic dispatch of method in jav Here, the reference of base class Shape (gen) is assigned with either the object of Rect,(r) or the object of Circ (c) depending on the user s input ( that means, it is at run time) so, the behavior of the statement 5) gen.showdata() is decided at run tim Hence it is dynamic dispatch of the metho (4m) It can also be said that concepts of Wrapper class methods and commandline arguments are represented because of the code line (3) (2m) How do you create your own package and import it in a java program? Explain the procedure step-wise using a suitable exampl Ans) The procedure should be explained step-wise giving any example cod Explain the below given code fragments : (i) interface values extends demoval { } Ans) This code is the definition of an interface in jav Here defined interface is values which is extended from another interface demoval. Here interface and extends are keywords. (2m) (ii) class sample extends dsamp implements dval {.. } Ans) In the above java code, sample and dsamp are class names and dval is an interfac (1m) Hence we can explain it as below : This is the definition of a class sample which is extended from another class dsamp and implements an interface dval (2m) 4. Attempt any three of the following: 15 What is a vector? List out any five vector methods and quote their functionality. Write one example for each. Ans) definition of vector (1m) Any five vector methods with a one line explanation of their functionality (4m) Write in detail about the life cycle of a thread in jav Ans) : diagram of the life cycle (1m) Brief explanation of all 5 states ( new born, runnable, running, blocked and terminated ) (4m) Explain any 3 different cases of exception handling. Ans ) brief explanation with short code segments from any three of the below cases 1) one try one catch block 2) one try many catch blocks

3) one try many catch finally 4) nested try-catch 5) throwing your own exception (i) FileReader ins = new FileReader(inf); Ans) this (ii) dos.writedouble(27.36); Explain the difference between the following using a suitable exampl (1m for each) (i) equals(), compareto(), equalsignorecase() Ans ) equals() : checks equality and returns Boolean value compareto() : compares and gives the numeric difference of first non-equal characters equalsignorecase() : checks for equality, but ignores case differences and returns Boolean valu substring(k) : gives substring from k th character, subtring(k, j) : gives substring from k th character to j th character (not including j) Ans ) : indexof( x ) : returns the position of the first occurance of the character x in the string. indexof( x, n); : returns the position of x after n th position in that string. Explain : (i) int k = Integer.parseInt(num); (ii) val = lval.longvalue(); (ii) dval = DoublvalueOf(s); Ans ) : The above code lines are conversions using Wrapper class methods.(1m + 2m + 2m) (i) Integer k is assigned to the converted value of the string num. here Integer is the wrapper class and parseint() a method in it. (ii) Here object to primitive conversion is don laval is object of the class Long. The method longvalue() converts it to the primitive long typ Hence the variable val is of long typ (iii) Here string to object conversion is don S is a string. The valueof() method of the class Double is converting it into primitive double valu This value is assigneed to the variable dval. 5. Attempt any three of the following: 15 Briefly explain : Delegation model : the modern approach of handling events in java in which the application logic that processes events is separated from the user interface logic that generates those events. (2m) Event : an object that describes a state change in a sourc (1m) Event listener : an object that is notified when an event occurs. (1m) Event sources : An object that generates events. (1m) What is an applet? Explain its life cycle in jav Ans) applet definition (1m) Explanation of life cycle with 4 states ( born, running, idle, dead) using block diagram. (4m) What is a Layout manager? Explain any two layouts. Ans) definition (1m) Explanation about any two layout managers(flow layout, grid layout, border layout, card layout) ( 2m for each) Write about : Button, Textfield, Label. Ans) usage of each control and at least one of its methods (2m for each) (i) public void paint(graphics g ) { }

(ii) Ans) This code indicates the definition of paint() method that performs the applet cod It takes the Graphics class object as an argument. (2m) (iii)addactionlistener(this); Ans) here, The addactionlistener method takes the current class object as a parameter. Here current class is the class of object b through which it is calle For eg. B can be an object of Button class. (iv) repaint(); Ans ) The repain() method is called to invoke the paint() metho (1m) Write about <APPLET> and <PARAM> tags. Ans) <applet> tag usage and attributes (3m) <param> tag usage and attributes (2m) & & &