java paper sets

11
CS74: INTRODUCTION TO INTERNET PROGRAMMING (Set-1) 1. Answers the following questions: a. Write any four differences between a Java Applet and a Java Application. Also, write any two common properties of them. Explain through an example for each. b. Indicate the name, type , size and range of values of any four primitive data types in Java. c. Write any three advantages of multi-threaded programing. d. Write a program in Java for l/O operations using BufferedlnputStream and BufferedOutputStream. 2. Answers the following questions: a. What is meant by Java Virtual Machine ? Explain. b. Explain any six bitwise operators of Java. Also, demonstrate each operator with an example. 3. Answers the following questions: a. Write a program in Java that accepts the name of a text file as input and prints the content of that file to standard output. b. Explain the architecture of a Java Applet with the help of a figure. 4. Answers the following questions: a. Explain the extends keyword with an example. b. What is an exception ? How will you handle them in Java programs ? c. How can a package be created in Java ? Give an example. 5. Answers the following questions: a. Do you agree with the statement that any Java program is 100% platform independent ? Justify your answer. b. Explain the three categories an Event. c. Write a program in Java that accepts a list of strings as input and prints all those strings to standard output which consistof all vowels in them.

Upload: sunil-patil

Post on 20-Oct-2015

53 views

Category:

Documents


1 download

DESCRIPTION

java q bank

TRANSCRIPT

Page 1: Java Paper Sets

CS74: INTRODUCTION TO INTERNET PROGRAMMING (Set-1)

1. Answers the following questions:a. Write any four differences between a Java Applet and a Java Application. Also,

write any two common properties of them. Explain through an example for each.b. Indicate the name, type , size and range of values of any four primitive data types

in Java.c. Write any three advantages of multi-threaded programing.d. Write a program in Java for l/O operations using BufferedlnputStream and

BufferedOutputStream.2. Answers the following questions:

a. What is meant by Java Virtual Machine ? Explain.b. Explain any six bitwise operators of Java. Also, demonstrate each operator with

an example.3. Answers the following questions:

a. Write a program in Java that accepts the name of a text file as input and prints the content of that file to standard output.

b. Explain the architecture of a Java Applet with the help of a figure.4. Answers the following questions:

a. Explain the extends keyword with an example.b. What is an exception ? How will you handle them in Java programs ?c. How can a package be created in Java ? Give an example.

5. Answers the following questions:a. Do you agree with the statement that any Java program is 100% platform

independent ? Justify your answer.b. Explain the three categories an Event.c. Write a program in Java that accepts a list of strings as input and prints all those

strings to standard output which consistof all vowels in them.

Page 2: Java Paper Sets

CS74: INTRODUCTION TO INTERNET PROGRAMMING (SET-2)

1. Answers the following questions:a. What is Java Virtual Machine (JVM) ? Explain.b. Why do we use interfaces in java ? Explain with example. c. What happens if an abstract modifier is applied to a class ? Explain.d. What do you mean by static data in a class ?e. Differentiate between :

1. Thread and process2. Applet and application program.3. Final and finalize

2. Answers the following questions:a. Write a program in java that prompts the user to enter an integer number. It

should throw a user-defined exception Invalid Number if number is negative. Also write the code for creating the user-defined function.

b. Will an error occur if a class with the same name exists in two different packages that you import using star form ? How can the error be avoided ?

c. When do we use parselnt () function ? Explain.3. Answers the following questions:

a. What is synchronized block in java ? Why do we use it ?b. What are predefined streams in java ?c. Describe the various mouse events in MouseEvent class in brief.d. Write the output statements :

int a=-4,b=8i). a^bii).a << 2

4. Answers the following questions:a. Explain the use of super keyword in java with the help of suitable example.b. Write a recursive function in java to find sum of n terms of the following series :

1+1/2+1/3+1/4+…… 5. Answers the following questions:

a. What is the difference between throwing an exception and catching an exception ? Explain with example.

b. Write a program in java that displays all Command Line arguments inreverse order.

c. Static functions can only access static data.why?

Page 3: Java Paper Sets

CS74: INTRODUCTION TO INTERNET PROGRAMMING (SET-3)

1. Answers the following questions:a. Explain the following keyword:

1. this2. throw3. Super4. protected5. transient

b. Explain the different access specifier and their scope.c. Explain event delegation model in AWT. What are the components of an event?

2. Answers the following questions:a. Explain the concept of method overriding. Can we override the method with in

the same class? Explain.b. What is inheritance Explain with an example.c. Write a java program to check the number is prime or not? Where the number will

be input by user.3. Answers the following questions:

a. What is a stream ? Write a Program that reads the contents of a ftle and writes it into another file.

b. What is a thread ? Explain different methods of thread class.4. Answers the following questions:

a. What is a static method? Why can not a static method use this and super? Explain with the help of example.

b. Explain at least 4 features of java.5. Answers the following questions:

a. Create a Java applet with a button “Display”.On click of button it should display Rectangle, oval, circle with in the Applet.

b. What are the wrapper classes? Why are they used?c. Explain the concept of an interface. What is scope and nature of variable and

methods defined in an interface.

Page 4: Java Paper Sets

CS74: INTRODUCTION TO INTERNET PROGRAMMING (SET-4)

1. Answers the following questions: a. Explain the following keyword with example:

1. abstract2. final3. throws4. instanceof5. finally

b. Write a method in Java that accepts a string from console and prints it in reverse order. (Do not use any built-in methods for doing the reversal).

c. Explain the life cycle of an applet. Create a program to explain the same. d. Explain at least three differences between Java Applet and Application.

2. Answers the following questions:a. What is a thread ? Explain multithreading and different states of a thread, with

example.b. Create an applet that displays the “Welcome Message” along with current date

and time.3. Answers the following questions:

a. What is constructor ? Explain the concept of constructor overloading with example.

b. What is the difference between == operator and string.equals() method? What is the difference between String and String BufferClass? Explain

4. Answers the following questions:a. Explain Grid, Flow and Border layout with example.b. Can we have a class which is final as well as abstract ? Explain with example.c. What is a stream ? Explain difference between Byte Stream and Character

Stream.5. Answers the following questions:

a. What is an exception ? Create a user defined exception that is thrown when a string is entered in lower case. Write a program in Java to use that exception.

b. What is an interface? Explain wiih examplec. Explain the concept of package. Create a package and import it in your program.

Page 5: Java Paper Sets

CS74: INTRODUCTION TO INTERNET PROGRAMMING (SET-5)

1. Answers the following questions:a. Explain the features of any four Java Libraries.b. List any 12 Java reserved words.c. Explain the states of a thread with figure.d. What is meant by Serialization ? Also differentiate between Transient and

Volatile keywords.2. Answers the following questions:

a. Draw the hierarchy chart for Java.applet.Applet class.b. Write an applet that accepts a string as input and prints it in reverse order.c. How does an interface differ from a class? Write at least two advantages of

interfaces.3. Answers the following questions:

a. Write a program in Java that accepts a string as input and converts it to a number. b. Explain the final keyword with an example. c. How are multiple exceptions handled in Java ? Give an example.

4. Answers the following questions:a. Explain any two features of Java. b. Write escape sequence for the following :

i). Line feedii). Back slash

c. What are the wrapper classes and the inner classes? Give an example of each.5. Answers the following questions:

a. Explain the finally reserved word with an example.b. Explain ClassNotFoundException and NullPointerException.c. Explain the process of adding classes to existing packages.

Page 6: Java Paper Sets

IT 2301 — JAVA PROGRAMMINGPART A — (10 × 2 = 20 Marks)1. What is the difference between static and non-static variables?2. What is the purpose of finalization?3. What is the difference between the String and String Buffer classes?4. Can an abstract class be final? Why?5. What is an anonymous inner class?6. What is the difference between the File and Random Access File classes?7. What are the advantages of the event-delegation model?8. What happens if an exception is not caught?9. What is the use of Reflection API?10. What are three ways in which a thread can enter the waiting state?

PART B — (5 × 16 = 80 Marks)

11. (a) Explain briefly the following object oriented concepts.(i) Abstraction and Encapsulation. (4)(ii) Methods and messages. (4)(iii) Inheritance. (4)(iv) Polymorphism. (4)Or

(b) (i) How objects are constructed? Explain constructor overloading withan example. (Marks 10)(ii) Write short notes on access specifiers in java. (Marks 6)

12. (a) What is a Package? What are the benefits of using packages? Write downthe steps in creating a package and using it in a java program with anexample. (Marks 16)Or(b) What is Dynamic binding? Show with an example how dynamic bindingworks. (Marks 16)

13. (a) What is object cloning? Why it is needed? Explain how objects are cloned.(Marks 16)Or(b) How is a Frame created? Write a java program that creates a productenquirer form using frames. (Marks 16)

14. (a) With a neat diagram explain the Model view controller design patternand list out the advantages and disadvantages of using it in designing anapplication. (Marks 16)Or(b) What is an Exception? Explain how to throw, catch and handleExceptions. (Marks 16)

15. (a) What is Generic programming and why is it needed? List the limitationsand restrictions of generic programming. (Marks 16)Or(b) Explain how to create threads. Write a java program that prints numbersfrom 1 to 10 line by line after every 5 seconds. (Marks 16)

B.E./B.Tech. DEGREE EXAMINATION, APRIL/MAY 2011 Fifth Semester Information Technology IT 2301 — JAVA PROGRAMMING PART A — (10 × 2 = 20 marks) 1. Give the properties of abstract classes and methods and write a suitable example. 2. Why does Java not support destructors and how does the finalize method

Page 7: Java Paper Sets

help in garbage collection? 3. Write a declaration to convert the value ‘‘Programmer’’ in the string variable ‘convert’ to ‘‘programming’’. 4. Distinguish between static and dynamic binding. 5. How does the declaration of a local inner class differ from the declaration of an anonymous inner class? 6. Write a code to copy the contents of the file input.txt one byte at a time to output.txt using FileInputstream and FileOutputStream. 7. When do the following events occur? (a) AdjustmentEvent (b) ItemEvent 8. Write down the statements used to create a JFrame and a JButton and then add the JButton to the JFrame. 9. List any two advantages of type parameters. 10. When would you use the CountDownLatch synchronizers and Exchange Synchronizers? PART B — (5 × 16 = 80 marks) 11. (a) (i) Write a program to find whether a number is a palindrome or not. (8) (ii) Discuss the working and meaning of the ‘‘static’’ modifier with suitable examples. (8) Or (b) Explain in detail as to how inheritance and polymorphism are supported in Java with necessary examples. (16)12. (a) (i) Write a Java program to perform matrix multiplication using arrays. (8) (ii) Write a java program to search for a number in the given array using binary search. (8) Or (b) Give a detailed explanation of packages in Java(16). 13. (a) What is reflection and how does it help to manipulate java code? (16)Or (b) Consider a class person with attributes firstname and lastname. Write a java program to create and clone instances of the Person class. (16)14. (a) Write a program to create a calculator using swings with the four basic arithmetic operations : +, –, *, /. (16)Or (b) Draw the exception hierarchy in java and explain with examples throwing and catching exceptions and the common exceptions.(16) 15. (a) With suitable examples consider the number of restrictions to consider when working with java generics. (16)Or (b) Write short notes on what threads are and the thread states and properties. (16)

Page 8: Java Paper Sets

how to develop logic in java programming LanguageJava programming logics with Examples question model.by solving below questions you can develop logic in java.1) What will happen, if main ( ) function is defined as private ?2) "Package statement is always the first non-comment statement in Java". Stale true/false and justify.3) What is ClassPath ?4) List any 4 layout managers available in Java.5) Write syntax of for loop for "for each" style.2. a) Write an applet to simulates a traffic signal light with short delay betweenstates. 8b) Explain JDBC drivers. 73. a) Explain object serialization. Write a program to copy the contents of one fileinto another file. Accept file names using command line arguments. 8b) Explain Servlet life-cycle. 74. a) Write a Servlet for e-mail registration with user id, password, name, dob. addressfields. Validate user id. If any user exist with same user id give proper message. Otherwise welcome user with message containing his/her user id and password. 10b) Differentiate between function overloading and overriding. 55. a) i) Write a Java Socket program that runs on client and sends a message toserver at port 8080. The program should display appropriate message returned by server.ii) Write a Java Socket program that runs on server at port 8080. which acceptsa message from client and send the same string lo client by changing thecase. ! 0b) Explain Delegation Event Model in Java. 56. Write short notes on any 3 : 151) Thread synchronization2) Autoboxing and Unboxing in Java3) EJB Types4) Finally clause in Exception Handling.

Posted bytirthraj Mishraat01:460 commentsEmail ThisBlogThis!Share to TwitterShare to FacebookShare to PinterestLabels:java-Programming

Java Programming Interview questions with model paperJava Programming Interview questions with model paperI. Answer the following with justification.1) Interfaces cannot be extended.a) True b) False2) Import statement is always the first non-comment statement in Java program file.a) True b) False3) Which of the following interfaces does not have any method or member variable.a) Serializable c) Runnableb) Comparable d) Cloneablc.4) A catch clause may catch exceptions of which type ?a) Throwable Type c) Exception Typeb) Error Type d) Siring Type5) The doCret () and doPost () methods are of HTTP servlet class,a) True b) False

a) Write an applet to display scrolling text from right to left in an applet window,using Thread. Text should be accepted by HTML parameter. b) Explain session tracking in servlet. 7I. a) Differentiate between Byle stream and character stream. Write a program to merge two files into third file.Accept file names using command line arguments. (Use Byte Streams). b) Explain steps involved in RMI application with example.

4. a) Wrilc a servlet to accept students information from HTML page, and store thedetails in a database.(Note : Take suitable fields, student table is already present), b) Explain the scopes of access specifiers in Java.

5. a) i) Write a Java Socket program that runs on client and sends a file name toserver at port 8000. The program should display appropriate message returned by server.ii) Write a Java socket program that runs on server at port 8000, which accepts afile name from client and checks file exists or not and returns proper messageto client. Ib) Explain Inner class with example.6. Write short notes on any 3 : 1) EJB Architecture.2) Adapter classes.

Page 9: Java Paper Sets

3) Layout managers.4) Class Object in Java.

Posted bytirthraj Mishraat01:280 commentsEmail ThisBlogThis!Share to TwitterShare to FacebookShare to PinterestLabels:java-Programming

Java Programming 2005 - Pattern | New | Mca Pune universityJava Programming (2005 - Pattern) (New).Java Programming 2005 - Pattern | New | Mca Pune university question papers.1. Solve the following : 10a) What is Inet Address ?b) How to instantiate Httpsession object ?c) Differentiate between abstract and final keywords.d) What is connection pooling ?e) List different types of EJB.

2. a) Write server side socket program to accept file name from client. Server willreverse the contents and send as response.b) Write client side socket program to accept filename from user and send toserver. Display the response received from server. 3. Write an applet application which will display colours in list box and a scrolling banner which scrolls to right. When user selects any colour from list, change the colour of scrolling banner ? 4. Write a RMI application to do the following :' Client will accept a string from user and communicates to the server. Client will invoke find vowel count - remote method on server, using accepted string and display vowel count from that string.Write all required classes or interfaces.

5. Accept mobile HANDSET details through HTML page. Pass the accepted details to servlet. Servlet will insert record in HANDSET table with values received from HTML page. Servlet will send response as whether record is inserted or not. Assume suitable table structure. 6. Write notes on (any 3) : a) Java. io. File class b) Thread life cycle c) Session tracking in servlets d) EJB architecture.