38
Department of Computer Science and Engineering Course Name : Java Programming Course Number : Course Designation: Core Prerequisites :C/C++ II B Tech II Semester (2015-2016)

Department of Computer Science and Engineeringanurag.edu.in/wp-content/uploads/java_course_file.pdf · Java- The Complete Reference, Seventh Edition, Herbert Schildt, Tata McGraw

  • Upload
    others

  • View
    148

  • Download
    9

Embed Size (px)

Citation preview

Department of Computer Science and

Engineering

Course Name : Java Programming

Course Number :

Course Designation: Core

Prerequisites :C/C++

II B Tech – II Semester (2015-2016)

2

SYLLABUS

Unit – I

UNIT -- I: Fundamentals of Object Oriented Programming: Object-Oriented

Paradigm, Basic Concepts of Object Oriented Programming- Objects and Classes, Data

abstraction and encapsulation, inheritance ,Polymorphism, Data binding, Message

Communication, Benefits of OOP, Applications of OOP. Java Basics History of Java,

Java buzzwords, data types, variables, scope and life time of variables, arrays, operators,

expressions, control statements, type conversion and costing, simple java program,

concepts of classes, objects, constructors, methods, access control, this keyword, garbage

collection, overloading methods and constructors, parameter passing, recursion, nested and

inner classes, Strings.

Unit – II

UNIT -- II: Inheritance – Base class object, subclass, subtype, substitutability, forms of

inheritance- specialization, specification, construction, extension, limitation, combination,

Member access rules, super uses, using final with inheritance, polymorphism- method

overriding, abstract classes, Object class Packages and Interfaces : Defining, Creating

and Accessing a Package, Understanding CLASSPATH, importing packages, differences

between classes and interfaces, File, Byte Streams, Character Streams, Stream I/O.

Unit – III

UNIT -- III: Exception handling - Concepts of exception handling, exception hierarchy,

usage of try, catch, throw, throws and finally, built in exceptions, creating own exception

sub classes. Package java.util- The Collection Interface, list interface, Queue interface,

The Collection class: LinkedListClass, HashSetClass. TreeSetClass, StringTokenizer,

Date, Random, Scanner. Multi threading: Differences between multi threading and

multitasking, thread life cycle, creating threads, thread priorities, synchronizing threads,

inter thread communication.

Unit – IV

UNIT -- IV: Event Handling: Events, Event sources, Event classes, Event Listeners,

Delegation event model, handling mouse and keyboard events, Adapter classes. AWT:

class hierarchy, component, container, panel, window, frame, canvas, graphics, Layout

Manager – layout manager types – boarder, grid, flow, card and grib bag.

Unit – V

UNIT -- V: AWT controls: Labels, button, canvas, scrollbars, text components, check

box, check box groups, choices, lists panels – scroll pane, dialogs, menu bar. Applets –

Concepts of Applets, differences between applets and applications, life cycle of an applet,

create applets, passing parameters to applets. JDBC Connectivity: JDBC Type 1 to 4

Drivers, connection establishment, QueryExecution

3

TEXT BOOKS & OTHER REFERENCES

Text Books

1. Java- The Complete Reference, Seventh Edition, Herbert Schildt, Tata McGraw

Hill.

2. Database Programming with JDBC&JAVA, Second Edition,GeorgeReese,

O’ReillyMedia.

Suggested / Reference Books

3. Understanding OOP with Java, updated edition, T. Budd, Pearson Education.

4. Thinking in Java Fourth Edition, Bruce Eckel

5. Introduction to Java programming, Y. Daniel Liang, Pearson Education.

Websites References

1. http://javabeginnerstutorial.com/core-java/

2. http://www.tutorialspoint.com/java/

3. http://portal.aauj.edu/portal_resources/downloads/programming/javap_programming_ language_handbook.pdf

4

Time Table

Room No: W.E.F:

Class Hour

Time

1 2 3 4

12

:20

– 1

:10

LU

NC

H B

RE

AK

5 6 7

9:00 -09:50 09.50 –10:40 10:40 –11:30 11:30 – 12: 20 1:10 – 2:00 2:00 – 2:50 2:50 – 3:40

MON

TUE

WED

THU

FRI

SAT

5

PROGRAM EDUCATIONAL OBJECTIVES (PEO’s)

PEO1 The Graduates are employable as software professionals in reputed

industries.

PEO2 The Graduates analyze problems by applying the principles of

computer science, mathematics and scientific investigation to

design and implement industry accepted solutions using latest

technologies.

PEO3 The Graduates work productively in supportive and leadership roles on

multidisciplinary teams with effective communication and team work

skills with high regard to legal and ethical responsibilities.

PEO4 The Graduates embrace lifelong learning to meet ever changing

developments in computer science and Engineering.

PROGRAM OUTCOMES (PO’s)

PO1 An ability to communicate effectively and work on multidisciplinary

teams

PO2 An ability to identify, formulate and solve computer system problems

with professional and ethical responsibility.

PO3 A recognition of the need for, and an ability to engage in life-long

learning to use the latest techniques, skills and modern engineering

tools

PO4 The broad education necessary to understand the impact of engineering

solutions in a global, economic, environmental and social context

PO5 An ability to apply knowledge of mathematics, science, and computing

to analyze, design and implement solutions to the realistic problems.

PO6 An ability to apply suitable process with the understanding of software

development practice.

6

Course Outcomes: Course Outcomes: Student will be able to:

1. Design, write and test a java program to implement the fundamental concepts of

Object Oriented Programming.

2. Write code to define classes and interfaces that uses class libraries such as

java.lang, java.util, java.io.

3.Use exception handling and multithreading in programs.

4.Develop GUI applications.

5. Implement object oriented solutions for the complex problems.

7

MAPPING OF COURSE OUT COMES WITH PO’s & PEO’s

Course Outcomes PO’s PEO’s CO1 PO2,PO5 PEO2

CO2 PO2,PO5 PEO2

CO3 PO2,PO5,PO6 PEO1,PEO2

CO4 PO6 PEO1,PEO2

CO5 PO2,PO5,PO6 PEO1,PEO2

8

COURSE SCHEDULE

Distribution of Hours Unit – Wise

Number of Hours / lectures available in this Semester / Year 55

Unit Topic

Chapters Total No. of

Hours Book1 Book2

I Ch1,2 - 5

II --- Ch3,4,5,6,7

6

III Ch8

- 7

IV Ch9

- 8

V -----

Ch10, 11 9

Contact classes for Syllabus coverage 54

Tutorial Classes : 05 ; Online Quiz : 1 Case studies-2 (Before Mid Examinations) Revision classes :1 per unit

9

Lecture Plan

Units TOPICS NO.OF

Hours

UNIT-I Object-Oriented Paradigm 1

Basic Concepts of Object Oriented Programming-

Objects and Classes

1

Data abstraction and encapsulation, inheritance

,Polymorphism, Data binding, Message Communication,

1

Benefits of OOP, Applications of OOP.

1

Java Basics History of Java, Java buzzwords, data types,

variables, scope and life time of variables,

1

arrays, operators, expressions, control statements, type

conversion and casting, simple java program,

1

concepts of classes, objects, 1

constructors methods, access control, this keyword,

garbage collection

1

overloading methods and constructors 1

parameter passing, recursion, nested and inner

classes,Strings.

1

Total 10

Unit -II Base class object, subclass, subtype, substitutability 1

forms of inheritance- specialization, specification,

construction, extension, limitation, combination

1

Member access rules, super uses, using final with

inheritance

1

polymorphism- method overriding, abstract classes,

Object class

1

Packages and Interfaces: Defining, Creating and

Accessing a Package, Understanding CLASSPATH

2

importing packages, differences between classes and

interfaces,

1

File, Byte Streams, Character Streams, Stream I/O.

3

Total 10

Unit-III Exception handling - Concepts of exception handling 1

exception hierarchy, usage of try, catch, throw, throws

and finally,

1

built in exceptions, creating own exception sub classes. 1

Package java.uti. The collection interface,list interface,

Queue interface.

3

StringTokenizer,Date,Random,scanner 2

10

MultiThreading:differences between multithreading and

multitasking

1

Thread lifecycle,creating threads 1

Thread priorities,synchronizing threads, inter thread

communication

1

Total 11

Unit-IV

Event Handling: Events, Event sources, Event classes

2

Event Listeners, Delegation event model 2

handling mouse and keyboard events 1

Adapter classes. 1

AWT: class hierarchy, component, container 1

panel, window, frame, canvas 2

Graphics, Layout Manager 1

layout manager types – border, grid, flow, card and grib

bag.

2

Total 12

Unit-V AWT controls: Labels, button, canvas, scrollbars, text

components

2

check box, check box groups, choices 2

lists panels – scrollpane, dialogs, menubar 1

Applets – Concepts of Applets, differences between

applets and applications

1

life cycle of an applet,creating applets, passing

parameters to applets

2

JDBC Connectivity: JDBC Type 1 to 4 Drivers

,connection establishment ,QueryExecution.

2

Total 10

11

Date of Unit Completion & Remarks

Unit – 1

Date : __ / __ / __

Remarks:

________________________________________________________________________

________________________________________________________________________

Unit – 2

Date : __ / __ / __

Remarks:

________________________________________________________________________

________________________________________________________________________

Unit – 3

Date : __ / __ / __

Remarks:

________________________________________________________________________

________________________________________________________________________

Unit – 4

Date : __ / __ / __

Remarks:

________________________________________________________________________

12

________________________________________________________________________

Unit – 5

Date : __ / __ / __

Remarks:

________________________________________________________________________

________________________________________________________________________

13

Unit Wise Assignments (With different Levels of thinking

(Blooms Taxonomy)) Note: For every question please mention the level of Blooms taxonomy

Unit – 1

1. List out the benefits and applications of OOP (L4)

2. List out the java buzzwords and explain them. (L1)

3.

Define Constructor? Describe various types of constructors with an

examples (L1)

4. Discuss in detail the access specifiers available in Java. (L6)

Unit – 2

1. Compare and contrast between the interface and class. (L5)

2. Define package? What is the significance of CLASS PATH variable?

(L1)

3.

Develop a abstract Reservation class which has Reserve abstract method.

Implement the sub-classes like Reserve Train and Reserve Bus classes

and implement the same. (L3)

4. Illustrate with examples: static and final. (L2)

Unit – 3

1. Describe briefly about thread life cycle. (L1)

2. Define exception? Explain about various keywords used in handling

the exceptions (L1)

3.

Compare and contrast between multi threading and multi tasking?

(L5)

4.

Implement user defined exceptions. (L3)

14

Unit – 4

1.

Create a java program to handle the mouse and keyboard events?

(L6)

2. Describe about various types of layout managers? (L1)

3. Define listener? Describe about Listener classes. (L1)

4.

Define adapter class and explain different types of adapter classes in

java.? (L1)

Unit – 5

1.

Design a program using AWT to create Text box and button for

accepting the name of the user and displaying “Hello username”

when is pressed? (L6)

2. Draw a circle by using an applet? (L3)

3. Describe briefly about applet life cycle? (L1)

15

Case Studies (With Higher Levels of thinking (Blooms Taxonomy)) Note: For every Case Study please mention the level of Blooms taxonomy

1(Covering Syllabus Up to Mid-1)

The Department of CSE is conducting case study for B.Tech II/II Students of CVSR

College.In that assessment students are asked to do following using Inheritance,

packages, Exception Handling and Strings

concepts:

a. Main class should display the following Menu:

Welcome to CVSR College. Choose your Department:

1. CSE

2. Mathematics

b. If the user chooses 1, implement the banking application After displaying the

following information

Welcome to Department of CSE, CVSR College

To implement the banking application with following methods.

1. Open account with initial amount 500

2. Deposit amount

3. Withdraw amount (to check the existence balance)

4. Display customer details (Name, account number, address, and balance amount)

Welcome to Department of CSE CVSR Engineering College

c. If the user chooses 2, implement Matrix multiplication of N x N square matrices

after displaying following information:

Welcome to Department Mathematics CVSR Engineering College

(CSP Rubric Name : Content Knowledge)

16

2(Covering Entire Syllabus)

Write a GUI application in java, which enter the details of a student and on the submit display

the details of the student.(Student details is like bio-data, it contains name, address, phone,

educational details, project details etc. ) Create three button in the GUI new, submit, view. When

the user click the submit button it stores the information of the student in the file. If the student

press the new button it stores the information of the new student. (stored that information by any

separator.) when View it show all the details of a student

(CSP Rubric Name : Technical and Analytical skills)

Unit Wise Multiple Choice Questions for CRT & Competitive Examinations

Unit – I:

1.Who is considered as the creator of JAVA ?

a) Dennis Richie b) Ken Thompson c) James Gosling d) Bjarne Stroupstrup

2. Which of the following statements about the Java language is true?

a) Java supports only Procedural Oriented Programming approach

b) Both Procedural and Object Oriented Programming are supported in Java

c) Java supports only Object Oriented Programming approach

d) None of the Above

3. JVM stands for?

a) Java Verified Machine b) Java Virtual Machine

c) Java Very large Machine d) Java Very small machine

3. JRE stands for

a. Java Realtime Environment b) Java Rapid Enterprise

c) Java Runtime Environment d) None of the above

4. Java source files are compiled and converted to

a) Object code b) machine code c) Bytecode d) executable file

17

5. JVM is ___________for bytecode.

a. a compiler b) an interpreter c) assembler d) none of the above

6. What is the size of int data type in java?

a) 1 bytes b) 2 bytes c) 4 bytes d) 8 bytes

7. Which is a valid float literal?

a) 1.23 b) 2 c) 1.23d d) 1.23f

8. What is the numerical range of a char in Java?

a) -128 to 127 b) 0 to 256 c) 0 to 32767 d) 0 to 65535

9. Which of these coding types is used for data type char in Java?

a) ASCII b) ISO-LATIN-1 c) UNICODE d) None of the mentioned

10. Which of these values can a boolean variable contain?

a) True & False b) 0 & 1 c) Any integer value. d) Both a & b

11. Which one of the following is a valid identifier in java?

a) x1 b) 1x c) $x d) x 1

12. Which one is the short circuit AND operator?

Answer : b

13. Which operator is used to implement unsigned right shift of an integer?

Answer : d

14. Which one of the following is a jump statement in java?

Answer : c

15. Which of these operators is used to allocate memory to array variable in Java?

a) malloc b) alloc c) new d) new malloc

Answer : c

16. What is the output of this program?

18

class increment {

public static void main(String args[])

{

int g = 3;

System.out.print(++g * 8);

}

}

a) 25 b) 24 c) 32 d) 33

Answer : c

a) & b) && c) | d) ||

a. << b) >> c) <<< d) >>>

a) goto b) jump c) break d) if

1. Which class cannot have a subclass in java

a) abstract class b)parent class c)final class d) None of above

a. Answer : c

2. Which is the keyword used to inherit a class to another?

a. Inherits b) extends c) implements d) import

b. Answer : b

3. The use of final keyword with method definition

a. Supports method overriding b) implements dynamic method dispatch

b. c) Prevents method overriding d) none of these

c. Answer : c

4. Identify the type of inheritance when two or more subclasses inherit the properties of

a super class.

19

b. c) Multilevel inheritance d) Hierarchical inheritance

c. Answer : d

5. The keyword used inside a class to refer to its immediate super class is

i. Multiple inheritance b) Single inheritance

a. super b) parent c) base d) none of these

b. Answer : a

6. Which of the following is true in the case of abstract class

a. Abstract constructors cannot be created.

b. Abstract classes can not be inherited.

c. An abstract class contains only abstract methods.

d. All of the above.

e. Answer : a

7. Which of these keywords are used to define an abstract class?

a) abst b) abstract

c) Abstract d) abstract class

a. Answer : b

8. If a class inheriting an abstract class does not define all of its function then it will be

known as?

a) abstract b) A simple class

c) Static class d) None of the mentioned

a. Answer : a

9. Which of these is not a correct statement?

a) Every class containing abstract method must be declared abstract.

b) Abstract class defines only the structure of the class not its implementation.

20

c) Abstract class can be initiated by new operator.

d) Abstract class can be inherited.

a. Answer : c

10. Which method defined in Integer class can be used to convert a whole number in

string type to primitive int type.

a. valueOf() b) intValue() c) parseInt() d) getInteger()

b. Answer : c

11. The method sqrt() is defined in the class

a. System b) Root c) Math d) Arithmetic

b. Answer : c

12. A primitive data type can be passed as an argument into a method

13. By value b) by reference

a. c) both a & b d) none of these

b. Answer : a

14. Which of these is used as default for a member of a class if no access specifier is used

for it?

a) private b) public c) public, within its own package

d) protected

a. Answer : c

15. Which of these keywords is used to refer to member of base class from a sub class?

a) upper b) super c) this d) None of the mentioned

a. Answer : b

16. Which of these is correct way of inheriting class A by class B?

21

a) class B + class A {}

b) class B inherits class A {}

c) class B extends A {}

d) class B extends class A {}

a. Answer : c

17. Which of the following are true about interfaces.

UNIT II a. Methods declared in interfaces are implicitly private.

b. Variables declared in interfaces are implicitly public, static, and final.

c. An interface contains any number of method definitions.

d. The keyword implements indicate that an interface inherits from another.

e. Answer : b

18. Which of these keywords is used to define interfaces in Java?

a) interface b) Interface c) intf d) implements

Answer : a

UNIT-III

1.Which of these keywords must be used to monitor for exceptions?

a) try..catch b) finally

c) throw d) throws

a. Answer : a

2.Which of these keywords is used to manually throw an exception?

a) try b) finally

c) throw d) catch

b. Answer : c

3.Which of these classes is related to all the exceptions that can be caught by using catch?

a) Error b) Exception

c) None of these d) a & b

c. Answer : b

22

4.Which of these classes is related to all the exceptions that cannot be caught?

a) Error b) Exception

c) None of these d) a & b

d. Answer : a

5.Which exception is thrown by read() method?

a) IOException b) InterruptedException

c) SystemException d) SystemInputException

e. Answer : a

6 Which is the super class of all exception classes

a) Exception b) Object c) Error d) Throwable

a. Answer : d

7. Which class is the super class of all classes of the java.lang package?

a. a) Object b) System c) Super d) Class

b. Answer : a

8. Which of the following exception is raised when a number is divided by zero

a. NumberFormatException b) ArithmeticException

b. NullPointerException d) IllegalArgumentException

c. Answer : b

9. A single try block must be followed by which of these?

a) finally b) catch

c) catch or finally d) None of the mentioned

d. Answer : c

10 Which of these exceptions will occur if we try to access the index of an array beyond

its length?

a) ArithmeticException b) ArrayException

c) ArrayIndexException d) ArrayIndexOutOfBoundsException

Answer : d

9. Runnable is a

i. a) Class b) Method c) Variable d) Interface

Answer : d

10. Thread priority in Java is represented as?

a) int b) Float

c) double d) long

Answer : a

23

11. Which of these class is used to make a thread?

a) String b) System

c) Thread d) Runnable

Answer : c

12. Which of these interface is implemented to create a Thread?

a) Runnable b) Connections

c) Set d) MapConnections

Answer : a

13. Which of these method of Thread class is used to find out the priority given to a

thread?

a) get() b) ThreadPriority()

c) getPriority() d) getThreadPriority()

Answer : c

14. Which of this method of Thread class is used to change the state of a thread to

blocked state?

a) sleep() b) terminate()

c) stop() d) block()

a. Answer : a

15. Which method in Thread class is used to check weather a thread is still running?

a) isAlive() b) Join()

c) isRunning() d) Alive()

a. Answer : a

16. Which of these methods is used to begin the execution of a thread?

a) run() b) start()

c) runThread() d) startThread()

a. Answer : b

24

17. Which of these method waits for the thread to treminate?

a) sleep() b) isAlive()

c) join() d) stop()

a. Answer : c

18. Which of these is used to read a string from the input stream?

a) get() b) getLine()

c) read() d) readLine()

a. Answer : d

19. Which of these classes is used to read characters and strings in Java from console?

a) BufferedReader b) StringReader

c) BufferedStreamReader d) InputStreamReader

a. Answer : d

20. Which of these classes are used by Byte streams for input operation?

a) InputStream b) InputOutputStream

c) Reader d) All of the mentioned

a. Answer : a

21. Which of these class contains the methods print() & println()?

a) System b) System.out

c) BufferedOutputStream d) PrintStream

a. Answer : d

22. Which of these methods can be used to write console output?

a) printout() b) println()

c) write() d) All of the mentioned

a. Answer : b

UNIT -IV

1. What does AWT stands for?

a) All Window Tools b) All Writing Tools

c) Abstract Window Toolkit d) Abstract Writing Toolkit

a. Answer : c

25

2. Which of these packages contains all the classes and methods required for event handling

in Java?

a) java.applet b) java.awt

c) java.event d) java.awt.event

a. Answer : d

3. What is an event in delegation event model used by Java programming language?

a) An event is an object that describes a state change in a source.

b) An event is an object that describes a state change in processing.

c) An event is an object that describes any change by the user and system.

d) An event is a class used for defining object, to create events.

a. Answer : a

4. Which of these methods are used to register a keyboard event listener?

a) KeyListener() b) addKistener()

c) addKeyListener() d) eventKeyboardListener()

a. Answer : c

5. Which of these methods are used to register a MouseMotionListener?

a) addMouse() b) addMouseListener()

c) addMouseMotionListner() d) eventMouseMotionListener()

a. Answer : c

6. What is a listener in context to event handling?

a) A listener is a variable that is notified when an event occurs.

b) A listener is an interface that is notified when an event occurs.

c) A listener is a method that is notified when an event occurs.

d) None of the mentioned

a. Answer : b

7. Which of these class is super class of all AWT events?

a) AWTEvent b) EventClass

c) ActionEvent d) ItemEvent

a. Answer : a

8. Which of these events will be generated if scroll bar is manipulated?

a) ActionEvent b) ComponentEvent

c) AdjustmentEvent d) WindowEvent

a. Answer : d

26

9. Which of these events will be generated if we close a Frame window?

a) ActionEvent b) ComponentEvent

c) AdjustmentEvent d) WindowEvent

Answer : d

10. Which of these events is generated when a button is pressed?

a) ActionEvent b) KeyEvent

c) WindowEvent d) AdjustmentEvent

Answer : a

11. Which of these methods can be used to obtain the command name for ActionEvent

object?

a) getCommand() b) getActionCommand()

c) getActionEvent() d) getActionEventCommand()

Answer : b

12. Which of these methods in KeyEvent class can be used to know which key is pressed?

a) getKeyCode() b) getModifier()

c) getActionKey() d) getActionEvent()

Answer : a

13. Which of these interfaces define a method actionPerformed()?

a) ComponentListener b) ContainerListener

c) ActionListener d) InputListener

Answer : c

14. Which of these interfaces define a method itemStateChanged()?

a) ComponentListener b) ContainerListener

c) ActionListener d) ItemListener

Answer : d

15. What are the sequences of method executed when an Applet starts execution?

a)init(),start(),stop(),destroy() b) load(),start(),stop(),unload()

c) init(),activate(),deactivate(),destroy() d) start(),init(),destroy(),stop()

Answer : a

16. The default layout manager of an Applet is

a) Flowlayout b) Gridlayout c) BorderLayout d) BoxLayout

Answer : a

17. The default layout manager of a Frame is

27

a) Flowlayout b) Gridlayout c) BorderLayout d) BoxLayout

Answer : c

18. Which package consist an applet class?

a) java.applet b) java.awt c) java.awt.applet d) java.event

Answer : a

19. How do you position a component using FlowLayout?

a)North, South, East, West

b)Assign a row/column grid reference

c) Pass a X/Y percentage parameter to the add method

d) Do nothing, the FlowLayout will position the component

Answer : d

20. How do you change the current layout manager for a container

a)Use the setLayout() method

b) Once created you cannot change the current layout manager of a component

c) Use the setLayoutManager() method d) Use the updateLayout() method

Answer : a

21. The AWT component used to display a single line of read-only text

a. A checkbox b) A Label c) A button d) A TextField

Answer : b

22. The method to get the text of a Label

a. getLabel() b) getText()

c) getString() d) getData()

Answer : b

23. The AWT component used for taking input from user.

a. A TextBox b) A Label

c) A button d) A TextField

Answer : d

24. The method to set the text of Textfield.

a. setLabel() b) setString()

c) setText() d) setData()

UNIT-V

1. An applet is a ___________ program.

a. Large b. Small c. Medium d. None of these

28

2. __________ refers to a command that allows you to run applets outside a web browser.

a. JavaViewer

b. AppletViewer

c. PackageViewer

d. None of these

3. _________ denotes the variables that receive the values of the arguments passed into the

method to provide the desired output.

a. Integer

b. Parameters

c. Instance variables

d. object

4. Applets use various methods of _________ class and _______ class.

a. Applet, Graphics

b. Applet, Image

c. Image, Graphics

d. None of these

5. The execution of an applet begins from the ________ method.

a. int

b. init( )

c. init

d. none of these

6. For the execution of a local applet, an __________ connection is must.

a. Internet

b. Networking

c. Both a & b

d. None of these

7. The sequence of methods invoked automatically when an applet is loaded till it is destroyed

is:

a. init(), paint(),start(),stop(),destroy()

b. start(),init(),paint(),stop(),destroy()

c. star(),paint(),init(),destroy(),stop()

d. init(),start(),paint(),stop(),destroy()

8. The _______ method is used to display a string on an applet.

29

a. drawString()

b. stringdraw()

c. String()

d. Draw()

9. The following tags are mandatory while creating an html document to display an applet:

a. NAME,CODE,HEIGHT

b. CODEBASE,HEIGHT,WIDTH

c. CODE,HEIGHT,WIDTH

d. CODE,NAME

10. The __________ attributes indicates the URL of the directory where the applet .class file

resides.

a. CODEBASE

b. BASECODE

c. NAMEBASE

d. BASENAME

11. The parameters can be passed to an applet by using <PARAM> tag in the following way:

a. <PARAMNAME=parameter_name VALUE=parameter_value>

b. PARAMNAME=parametername VALUE=parametervalue

c. <PARAMNAME=parameter_name><VALUE=parameter_value>

d. None of these

12. What will be the output of the following code:

gra.drawLine(10,10,50,10);

a. A vertical line that is 40 pixels long

b. A vertical line that is 50 pixels long

c. A horizontal line that is 40 pixels long

d. A horizontal line that is 50 pixels long

13. Which of the following is not a method of Graphics class:

a. drawRectangle()

b. fillCircle()

c. drawArc()

d. drawEllipse()

e. Both b & d

14. The code given below a line.what will be the color of line:

g.setColor (color.red.yellow.green.cyan.blue)

gra.drawLine (20, 20, 20, 70)

a. Black

b. Blue

c. Red

30

d. Green

15. Write a statement to construct a20-point bold Serif font.

a. new Font(“Serif ”, Font.BOLD,20);

b. new Font(Serif , Font 20);

c. new (“Serif”, Font.BOLD,20);

d. new Font(“Serif”,20);

16. The __________ method of the graphics class is used to draw an image on an applet.

a. drawGraphic()

b. drawImage()

c. drawPic()

d. None of these

17. The java programs that have been discussed so far are _________ application programs.

a. Console-based

b. Object-based

c. Public-based

d. Method-based

18. The most significant features of an applet is that it transforms a _____________ user

interactive webpage by adding images, animations, different text styles to it.

a. Dynamic webpage into a static

b. Static webpage into a dynamic

c. Static webpage into a html

d. None of these

19. In other words, applets help a programmer to develop a full-featured _________ application.

a. Documents

b. Networking

c. Multimedia

d. None of these

20. The java applets can be executed either through an ___________ (a tool of java development

kit) or any java-compatible Web browser.

a. AppletViewer

b. Javac

c. JavaViewer

d. jdk*

21. Applet can be classified into ____ types:

31

a. 3

b. 4

c. 2

d. 6

22. The _______ class is responsible for all the operations related to display (output) of an applet.

a. Graphics

b. Images

c. Objects

d. Main

23. Life cycle of an applet:

a. Running, idle, born, dead

b. Idle, running, born, dead

c. Born, running, idle, dead

d. Running, dead, born, idle

24. The life cycle of an applet begins when it is first loaded and the _______ method is invoked.

a. start()

b. paint()

c. init()

d. stop()

25. _________ method is invoked to display the output on the screen in the form of text, graphics

etc.

a. graphics()

b. paint()

c. image()

d. init()

32

Previous Question Papers

33

Tutorial Sheet

Date: Topics Revised

Date: Topics Revised

Date: Topics Revised

Date: Topics Revised

34

Date: Topics Revised

Date: Topics Revised

TOPICS BEYOND SYLLABUS

S.No. Topic

1

2

3.

4.

5.

6.

35

ASSESMENT OF COURSE OUTCOMES: DIRECT

Blooms Taxonomy:

LEVEL 1 REMEMBERING Exhibit memory of previously learned material by recalling facts,

terms, basic concepts, and answers

LEVEL 2 UNDERSTANDING Demonstrate understanding of facts and ideas by organizing,

comparing, translating, interpreting, giving descriptions, and

stating main ideas.

LEVEL 3 APPLYING

Solve problems to new situations by applying acquired

knowledge, facts, techniques and rules in a different way

LEVEL 4 ANALYZING Examine and break information into parts by identifying motives

or causes. Make inferences and find evidence to support

generalizations.

LEVEL 5 EVALUATING Present and defend opinions by making judgments about

information, validity of ideas, or quality of work based on a set of

criteria.

LEVEL 6 CREATING Compile information together in a different way by combining

elements in a new pattern or proposing alternative solutions.

*Attach course assessment sheet

36

ASSESMENT OF COURSE OUTCOMES: INDIRECT

CSP Rubric

S.N

0

Criteria LEVEL ( Level : 3-Excellent Level :2-Good Level : 1-Poor)

1

Ora

l

Com

mu

nic

ati

on

3 Student speaks in phase with the given topic confidently using Audio-Visual aids.

Vocabulary is good

2 Student speaking without proper planning, fair usage of Audio-Visual aids.

Vocabulary is not good

1 Student speaks vaguely not in phase with the given topic. No synchronization

among the talk and Visual Aids

2

Wri

tin

g S

kil

ls

3

Proper structuring of the document with relevant subtitles, readability of document

is high with correct use of grammar. Work is genuine and not published anywhere

else

2 Information is gathered without continuity of topic, sentences were not framed

properly. Few topics are copied from other documents

1 Information gathered was not relevant to the given task, vague collection of

sentences. Content is copied from other documents

3

Soci

al

an

d

Eth

ical

Aw

are

nes

s

3 Student identifies most potential ethical or societal issues and tries to provide

solutions for them discussing with peers

2 Student identifies the societal and ethical issues but fails to provide any solutions

discussing with peers

1 Student makes no attempt in identifying the societal and ethical issues

4

Con

ten

t

Kn

ow

led

ge 3 Student uses appropriate methods, techniques to model and solve the problem

accurately

2 Student tries to model the problem but fails to solve the problem

1 Student fails to model the problem and also fails to solve the problem

5

Stu

den

t

Part

icip

at

ion

3 Listens carefully to the class and tries to answer questions confidently

2 Listens carefully to the lecture but doesn’t attempt to answer the questions

1 Student neither listens to the class nor attempts to answer the questions

6

Tec

hn

ical

an

d

an

aly

tica

l S

kil

ls 3

The program structure is well organized with appropriate use of technologies and

methodology. Code is easy to read and well documented. Student is able to

implement the algorithm producing accurate results

2

Program structure is well organized with appropriate use of technologies and

methodology. Code is quite difficult to read and not properly documented. Student

is able to implement the algorithm providing accurate results.

1

Program structure is not well organized with mistakes in usage of appropriate

technologies and methodology. Code is difficult to read and student is not able to

execute the program

37

*Attach course assessment sheet

7

Pra

ctic

al

Kn

ow

led

ge

3 Independently able to write programs to strengthen the concepts covered in theory

2 Independently able to write programs but not able to strengthen the concepts

learned in theory

1

Not able to write programs and not able to strengthen the concepts learned in

theory

8

Un

der

stan

din

g o

f

En

gin

eeri

ng c

ore

3 Student uses appropriate methods, techniques to model and solve the problem

accurately in the context of multidisciplinary projects

2 Student tries to model the problem but fails to solve the problem in the context of

multidisciplinary projects

1

Student fails to model the problem and also fails to solve the problem in the context

of multidisciplinary projects

38

Add-on Programmes:

1

2

3

4

Guest Lectures:

1. 2.

3.

4.

Unit Wise PPT’s:

Unit Wise lecture Notes: