100% found this document useful (2 votes)
134 views12 pages

Jpr Question Paper

The document outlines an examination paper consisting of multiple questions related to Java programming, including topics such as constructors, inheritance, threading, exception handling, and file operations. It specifies instructions for answering the questions, including the requirement to illustrate answers with sketches and the prohibition of electronic devices in the examination hall. The paper is divided into sections with varying marks assigned to different questions, requiring students to demonstrate their understanding of Java concepts and programming skills.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (2 votes)
134 views12 pages

Jpr Question Paper

The document outlines an examination paper consisting of multiple questions related to Java programming, including topics such as constructors, inheritance, threading, exception handling, and file operations. It specifies instructions for answering the questions, including the requirement to illustrate answers with sketches and the prohibition of electronic devices in the examination hall. The paper is divided into sections with varying marks assigned to different questions, requiring students to demonstrate their understanding of Java concepts and programming skills.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 12
22412 12223 3 Hours / 70 Marks Seat No. Instructions — (1) All Questions are Compulsory. 2) (2) Answer each next main Question on a new page (3) Illustrate your answers with neat sketches wherever necessary. (4) Figures to the right indicate full marks (5) Assume suitable data, if necessary. (6) Mobile Phone, Pager and any other Electronic Communication devices are not permissible in Examination Hall Marks Attempt any FIVE of the following : 10 State any four relational operators and their use Enlist access specifiers in Java Explain constructor with suitable example List the types of inheritance which is supported by java. Define thread. Mention 2 ways to create thread. Distinguish between Java applications and Java Applet (Any two points) Draw the hierarchy of stream classes. PTO. @ scanned with OKEN Scanner 22412 a) b) c) @d) a) b) [2] Marks Attempt any THREE of the following : 12 Write a program to check whether the given number is prime or not. Define a class employee with data members ‘empid’, ‘name’ and ‘salary’, Accept data for three objects and display it Describe Life cycle of thread with suitable diagram Write a program to read a file (Use character stream) Attempt any THREE of the following : 2 Write a program to find reverse of a number. State the use of final keyword with respect to inheritance Give the usage of following methods i) drawPolygon ( ) ii) DrawOval ( ) iii) drawLine ( ) iv) drawAre ( ) Write any four methods of file class with their use. Attempt any THREE of the following : 2 Write all primitive data types available in Java with their storage sizes in bytes. Write a program to add 2 integer, 2 string and 2 float values in a vector, Remove the element specified by the user and display the list Develop a program to create a class “Book” having data members ‘author’, ‘title’ and ‘price’. Derive a class ‘BookInfo’ having data member ‘stockposition’ and method to initialize and display the information for three objects. Mention the steps to add applet to HTML file. Give sample code. Write a program to copy contents of one file to another. @ scanned with OKEN Scanner b) a) b) 3] Marks Attempt any TWO of the following : 12 Compare array and vector. Explain elementAT( ) and addElement() methods. Write a program to create a class ‘salary’ with data members ‘empid’, ‘name’ and ‘basicsalary’. Write an interface ‘Allowance’ which stores rates of calculation for da as 90% of basic salary. hhra as 10% of basic salary and pf as 8.33% of basic salary Include a method to calculate net salary and display it Define an exception called “No Match Exception’ that is thrown when the passward accepted is not equal to “MSBTE* Write the program, Attempt any TWO of the following : 12 Write a program to check whether the string provided by the user is patindrome or not. Define thread priority ? Write default priority values and the methods to set and change them Design an applet to perform all arithmetic operations and display the result by using labels. textboxes and buttons. @ scanned with OKEN Scanner 22412 21222 3 Hours / 70 Marks Seat No. 15 minutes extra for each hour Instructions — (1) All Questions are Compulsory. (2) Answer each next main Question on a new page (3) Illustrate your answers with neat sketches wherever necessary. (4) Figures to the right indicate full marks (5) Assume suitable data, if necessary. (6) Mobile Phone, Pager and any other Electronic Communication devices are not permissible in Examination Hall Marks 1 Attempt any FIVE of the following: 10 a) Enlist the logical operators in Java b) Give the syntax and example for the following functions i) min) ii) Sqrt () ©) Define the interface in Java d) Enlist any four inbuilt packages in Java e) Explain any two methods of File Class. £) Write syntax of elipse g) Enlist any four compile time errors PTO. @ scanned with OKEN Scanner 22412 b) ©) d [2] Marks Attempt any THREE of the following: 12 Explain any four features of Java. Write a Java program to copy the content of one file into another. Write the difference between vectors and arrays. (any four points) Explain exception handling mechanism, w.rt. try, catch, throw and finally. Attempt any THREE of the following: 12 Write a Java program to find out the even numbers from 1 to 100 using for loop Explain any four visibility controls in Java. Explain single and multilevel inheritance with proper example. Write a java applet to display the following output in Red color. Refer Fig No. | Fig_No. 1. Attempt any THREE of the following: 12 Explain switch case and conditional operator in java with suitable example. Draw and explain life cycle of Thread Write a java program to sort an I-d array in ascending order using bubble-sort Explain how to create a package and how to import it Explain i) drawLine ii) drawOval iii) drawReet iv) drawAre @ scanned with OKEN Scanner a) b) 3] Marks Attempt any TWO of the following: 2 How to create user defined package in Java. Explain with an suitable example Write a Java program in which thread A will display the even numbers between 1 to 50 and thread B will display the odd numbers between 1 to 50. After 3 iterations thread A should go to sleep for 300ms What is constructor? List types of constructor. Explain paramaterized constructor with suitable example Attempt any TWO of the following: 12 Write a Java program to count the number of words from a text file using stream classes. Explain the difference between string class and string buffer class. Explain any four methods of string class Write a Java applet to draw a bar chart for the following values Year Turnover (Rs. crores) @ scanned with OKEN Scanner 22412 11920 3 Hours / 70 Marks Seat No, Instructions ~ (1) All Questions are Compulsory. (2) Answer each next main Question on a new page (3) Illustrate your answers with neat sketches wherever necessary. (4) Figures to the right indicate full marks (5) Assume suitable data, if necessary. (6) Mobile Phone, Pager and any other Electronic Communication devices are not permissible in Examination Hall Marks Attempt any FIVE of the following: 10 Define constructor. List its types. Define class and object. List the methods of File Input Stream Class. Define error. List types of error. List any four Java API packages. Define array. List its types. List access specifiers in Java. PTO. @ scanned with OKEN Scanner 22412 b) @d) [2] Marks Attempt any THREE of the following: 12 Differentiate between String and String Buffer, Define a class circle having data members Pi and radius Initialize and display values of data members also calculate area of circle and display it Define exception. State built-in exceptions. Write a syntax and example of (i) drawReet( ) (ii) drawoval( ) Attempt any THREE of the following: 12 Explain the following classes (i) Byte Stream Class (ii) Character Stream Class Explain life cycle of Applet Differentiate between class and interfaces, Define type casting. Explain its types with syntax and example, Attempt any THREE of the following: 2 Explain life cycle of thread Describe final variable and final method. Explain any two logical operators in Java with example. Differentiate between array and vector. List any four methods of string class and state the use of each. @ scanned with OKEN Scanner a) b) [3] Marks Attempt any TWO of the following: 2 Write a program to create vector with five elements as (5, 15, 25, 38, 45). Insert new element at 2" position Remove Ist and 4th element from vector. Define packages. How to create user defined package? Explain with example Write a program to create two threads one thread will print even no. between | to 50 and other will print odd number between I to 50 Attempt any TWO of the following: 12 Explain how to pass parameter to an applet? Write an applet to accept username in the form of parameter and print “Hello ”. Write a program to perform following task. (i) Create a text file and store data in it. (ii) Count number of lines and words in that file. Implement the following inheritance Interface - Salary Class : Employee | Basic_Salary Basic Sal( ) V f Class: Gross_Salary TA, DA, HRA ‘Total_Sal( ) @ scanned with OKEN Scanner 22412 21819 3 Hours / 70 Marks Seat No, Instructions ~ (1) All Questions are Compulsory. (2) Answer each next main Question on a new page (3) Figures to the right indicate full marks (4) Assume suitable data, if necessary (5) Use of Non-programmable Electronic Pocket Calculator is permissible (6) Mobile Phone, Pager and any other Electronic Communication devices are not permissible in Examination Hall Marks 1 Attempt any FIVE of the following: 10 a) List any eight features of Java b) State use of finalize() method with its syntax. ©) Name the wrapper class methods for the following (i) To convert string objects to primitive int (ii) To convert primitive int to string objects d) List the types of inheritances in Java. ©) Write the syntax of try-catch-finally blocks £) Give the syntax of < param > tag to pass parameters to an applet. 2) Define stream class. List its types PTO. @ scanned with OKEN Scanner 22412 a) b) d) b) ©) d) [2] Marks Attempt any THREE of the following: 12 Explain the concept of platform independence and portability with respect to Java language. Explain the types of constructors in Java with suitable example. Explain the two ways of creating threads in Java. Distinguish between Input stream class and output stream class. Attempt any THREE of the following: 2 Define a class student with int id and string name as data members and a method void SetData ( ). Accept and display the data for five students. Explain dynamic method dispatch in Java with suitable example. Describe the use of following methods (i) Drawoval ( ) (i) getFont ( ) (iii) drawRect ( ) (iv) getFamily ( ) Write a program to count number of words from a text file using stream classes. Attempt any THREE of the following: 12 Describe instance Of and dot (-) operators in Java with suitable example. Explain the four access specifiers in Java Differentiate between method overloading and method overriding, Differentiate between Java Applet and Java Application ( any four points) Write a program to copy content of one file to another file @ scanned with OKEN Scanner b) c) 3] Marks Attempt any TWO of the following: 12 Describe the use of any methods of vector class with their syntax, Explain the concept of Dynamic method dispatch with suitable example, Write a program to create two threads. One thread will display the numbers from I to 50 (ascending order) and other thread will display numbers from 50 to 1 (descending order) Attempt any TWO of the following: 12 Explain the command line arguments with suitable example Write a program to input name and salary of employee and throw user defined exception if entered salary is negative. Describe the applet life cycle in detail @ scanned with OKEN Scanner

You might also like