java-2013

2
B.E/B.Tech. DEGREE EXAMINATION, MAY/JUNE 2013. Fifth Semester Information Technology IT 2301/IT 51/10144 IT 501- JAVA PROGRAMMING (Regulation 2008/2010) Time: Three hours Maximum : 100 Marks Answer ALL questions PART A-(10 x 2 =20 marks) 1) What is static in java 2) What is the difference between a constructor and a method? 3) What is a string buffer class and how does it differs from string class? 4) Why is multiple inheritance using classes a disadvantage in java? 5) How to define an interface? 6) What is a stream and which class allows you to read objects directly from a stream? 7) What is the relationship between an event- listener interface and an event adapter class? 8) Why are swing components called lightweight component? 9) What is java virtual machine? 10) Why do we need run() and start() method both? Can we achieve it with only run method? PART B-(5x16=80 marks) 11) a) i) What does it mean that a method or class is abstract? Can we make an instance of an abstract class? Explain it with example. (8) ii) What is polymorphism in java? Explain how polymorphism is supported in java.(8) Or b) i) What is constructor in java? Why constructor does not have return types in java? Explain in with proper example. (8) ii) Why do we need static members and how to access them? Explain it with clear example (8) 12) a) Write a java program to maintain the books details like BookId, accession number; book name, author, publication in books package and keep the journal details such as journal Id; journal Id; journal name; in journal package in main class use these two packages details for staff and student classes and display the books and journals information as requested by the user. (16) Or b) How to declare and initialize a string in java and also explain the different string handling functions with suitable examples.(16) 13) a) Write a program to create interface method named customer. In this keep the methods called information(), show() and also maintain the tax rate. Implement this interface in employee class and calculate the tax of the employee based on their income. www.auupdates.com

Upload: shanthinisampath

Post on 30-Jan-2016

14 views

Category:

Documents


0 download

DESCRIPTION

java qp

TRANSCRIPT

Page 1: java-2013

B.E/B.Tech. DEGREE EXAMINATION, MAY/JUNE 2013.Fifth Semester

Information TechnologyIT 2301/IT 51/10144 IT 501- JAVA PROGRAMMING

(Regulation 2008/2010)Time: Three hours Maximum : 100Marks

Answer ALL questionsPART A-(10 x 2 =20 marks)

1) What is static in java2) What is the difference between a constructor and a method?3) What is a string buffer class and how does it differs from string class?4) Why is multiple inheritance using classes a disadvantage in java?5) How to define an interface?6) What is a stream and which class allows you to read objects directly from a stream?7) What is the relationship between an event- listener interface and an event adapter class?8) Why are swing components called lightweight component?9) What is java virtual machine?10) Why do we need run() and start() method both? Can we achieve it with only run method?

PART B-(5x16=80 marks)11) a) i) What does it mean that a method or class is abstract? Can we make an instance of anabstract class? Explain it with example. (8)

ii) What is polymorphism in java? Explain how polymorphism is supported in java.(8)Or

b) i) What is constructor in java? Why constructor does not have return types in java? Explain inwith proper example. (8)

ii) Why do we need static members and how to access them? Explain it with clearexample (8)12) a) Write a java program to maintain the books details like BookId, accession number; bookname, author, publication in books package and keep the journal details such as journal Id;journal Id; journal name; in journal package in main class use these two packages details for staffand student classes and display the books and journals information as requested by the user. (16)

Orb) How to declare and initialize a string in java and also explain the different string handling

functions with suitable examples.(16)13) a) Write a program to create interface method named customer. In this keep the methodscalled information(), show() and also maintain the tax rate. Implement this interface in employeeclass and calculate the tax of the employee based on their income.www.au

upda

tes.co

m

Page 2: java-2013

Orb) i) How will you display an image on the frame in a window using java. (8)

ii) What is meant by stream? What are the types of streams and classes? Explain in detail.(8)

14) a) What is event handling in java? List out the available event classes and listener interfaceswith suitable example. (16)

Orb) What is exception handling in java? Why it is used? Write a java code to simulate the way astack mechanism works with exception handling, throwing and dealing with exceptions such asstack is full(if you want to add more elements into the stack) or stack is empty(you want to popelements from the stack).

15) a) Explain in detail about generic classes and methods in java with suitable example.(16)Or

b) Write a java program for inventory problem to illustrates the usage of thread synchronizedkeyword and inter thread communication process. They have three classes called consumer,producer and stock.

www.auup

dates

.com