Java Questions
Home | About Me | Favorite Links | Question Papers | etm java papers
etm java papers

SET 1 nov-2003
    1. write about any 6 distinct features in Java Programming
    2. Write about the standard data types in Java
    1. What is meant by overloading methods? What are advantages of overloading concept?
    2. Write a method to find Area that can find the area of the circle/ square/rectangle using overloading concept.
    1. Consider two calls
       public class D extends B 
                                 			{ public void f()
                                 				{this.g(); //1
                                 				}
                                 			 public void g()
                                 				{ super.g(); //2
                                 				}
                                 			............
                                 			}    
      Which one of them is an example of early binding? Which one of them is an example of late binding? Explain.
    2. Explain the term shallow copy and deep copy
    3. Implement a super class Person. Make Y two classes, Student and Instructor , Inherit from Person. A person has a name and a year of Birth. A student has a major and an instructor has a salary.Write the Class definitions , the constructors.
  1. Develop an applet that receives three numerical values as a input from the user and then displays the largest of the three on the screen .Write a HTML page and test the applet.
    1. How is a container different from other types of components?
    2. What is window? What are the operations of Window?
    1. Explain applet basics? State how it runs in a window.
  2. Write a short notes on the following :
    1. RuntimeException
    2. Uncaught Exception
    3. Statements used to handle exceptions in Java
  3. Write a Java program to read a list of elements from a data file and store the list in :
    1. the same file
    2. another file
set 2 -nov 2003
    1. Discuss the different types of literals available in Java.
    2. Write about automatic type conversion and explain when casting is needed?
    1. Can constructors in Java be overloaded? If so illustrate with an example .
    2. Discuss the JDK and its components in brief.
    1. What is default package in Java programs?
    2. Suppose the class Sub extends the class Sandwich. Which of the following assignments are legal?
      		Sandwich  x = new Sandwich();
                                 		Sub y = new Sub();
                                 		x = y ;
                                 		y = x;
                                 		y = new Sandwich();
                                 		x = new Sub();
                                 		
    3. How does a cast class references such as (Savings Account)b differ from a cast of number values such as (int) x ?
    4. Explain the two meanings of the super keyword ? Explain the two meanings of this keyword. How are they related?
    1. Explain the event driven programming?
    2. write briefly applet display methods.
  1. Write a program to draw several shapes in the created window using applets
  2. Explain the various methods defined in the applet class in detail.
  3. Write a short notes on the following
    1. Types of Exceptions
    2. Cautions in using exception clause
    3. Multi threading
    4. Thread groups
    1. Explain the functions of PrintStream and DataInputStream
    2. Summarize the list and explain the important methods available under the File class
SET 3 -Nov-2003
    1. Write down the syntax and working procedure of loop structures while & do... while in Java.
    2. discuss the following i) Code reusability ii) Data Abstraction
    1. Distinguish between overloading and overriding
    2. when do we declare a method as final.
    3. Explain the difference between
      		new BankAccount[2000];
                                 
                                 			And 
                                 		BankAccount b;
    4. Implement a class Student. A Student has a name and a total quiz score. Supply an appropriate constructor and methods getName(), addQuiz(int score), getTotalScore() and getAverageScore(). To Compute the latter, you also need to store the number of quizzes that the student took.
    1. Write a Java program, which will read a string and rewrite in the Alphabetical order, For example, the word STRING should be Written as GINRST
    2. what is a vector? How does it differ from an array?
    3. Write a Java program that accepts a shopping list of five items from the command line and stores them in a vector.
  1. What is task perform by the layout manager and Explain briefly different types of layout managers.
  2. What is the purpose of mouse event class? Explain its method in detail.
  3. Discuss the applet initialization and termination, and the methods involved in it in detail.
    1. Explain how exceptions are handled in Java. Demonstrate how exceptions are thrown.
    2. Describe with the help of a diagram the exception class hierarchy.
    1. Summarize the list of byte stream classes.
    2. Summarize the list of the character stream I/O classes.
SET 4 nov-2003
    1. Write the different kinds of arithmetic and relational operators in Java.
    2. Discuss the package java.lang in detail.
    1. Give a Java code to construct the following objects.
      • a square with center (100,100) and side length 25
      • A bank account with a balance of Rs.5000
      • A console reader that reads from System.in
      • If b1 and b2 store objects of class BankAccount , Consider the following instructions
        b1.deposit(b2.getbalance());
        b2.deposit(b1.getbalance());
        Are the balances of b1 and b2 now identical? Explain.
      • Implement a class Circle that has methods getArea() and getCircumference(). In the constructor, supply the radius of the circle.
    1. What are the advantages of inheritance ?
    2. Explain how the objects are passed as arguments to methods with an example.
    3. Write a Java program which will read a text and count all occurrences of a given word.
  1. Write an applet to display the following figure
  2. Write an example show the handling of mouse events in JAVA?
  3. "Applets override update() method of AWT" . Justify the statement with an example in detail.
    1. Demonstrate the use of thread synchronization primitives.
    2. Demonstrate the use of multiple threads in Java.
  4. Explain the following:
    a) InputStream b) OutputStream c) Reader d)Writer
SET 1 nov-2004
    1. What is a Java Applet? What is advantage of writing applets in Java? How it differs from different from application programs?
    2. What is the usage of import statement? Explain with suitable example.
    1. What is meant by overloading methods? What are the advantages of overloading concept?
    2. Write a method to find Area that can find the area of circle/square /rectangle using overloading concept.
    1. Write a Java Program to insert an element in the given array in the given position
    2. List out the features of String class
  1. Develop an Applet that receives three numerical values as a input from the user and then displays the displays the largest of the three on the screen. Write a HTML page and test the applet.
    1. How is a container different from other types of components ?
    2. What is window? What are the operations of window?
  2. Discuss the applet initialization and termination , and the methods involved it in detail
  3. why exception handling is considered one of the important features in OOP . Write your explanation with suitable examples.
  4. Write short notes on the following:
    1. Interactive input and output screens
    2. Processing external files
    3. Random access files
    4. Exception handling
SET 2 nov-2004
    1. Explain the usage of switch statement in Java by writing suitable example program in Java.
    2. In which ascpect, public data members differ from private and protected data members in Java program? Explain the concept with a suitable example.
    1. Can constructors in Java be overloaded? If so illustrate with an example.
    2. Discuss the JDK and its components in brief
    1. Write a Java program to delete an element from a given array.
    2. Write a Java program to find the determinant of a given matrix
    1. Explain the event driven programming
    2. Write briefly applet display methods.
  1. Write a program to draw several shapes in the created window using applets.
  2. "Applets override update() method of AWT." Justify the statement with an example in detail.
  3. What are the clauses used in Java to handle exceptions? Explain the syntax of each clause with necessary examples
    1. List out any four Java's Checked Exceptions defined in java.lang ? Explain it's use with an example?
    2. What are the differences between
      1. a stream and a reader
      2. sequential access and random access
SET 3 nov-2004
    1. Write down the syntax & working of loop structures, while & do-while in Java.
    2. Discuss the following : i) Code reusability ii) Data Abstraction
    1. Distinguish between over loading and overriding
    2. when do we declare a method as final
    3. Explain the difference between
       new  BankAccount[2000];
                                 			And
                                 			BankAccount b;
                                 			
    4. Implement a class Student. A Student has name and a total quiz score . Supply an appropriate constructor and methods getName() , addQuiz(int score) , getTotalScore() and getAverageScore() . To Compute the later you also need to store the number of quizess that the student took.
    1. Explain method overloading with an example.
    2. What are the advantages of final class.
    3. Write a program to describe how multi dimensional arrays can be used
  1. What is task perform by the layout manager and explain briefly different types of layout managers.
  2. What is the purpose of mouse event class? Explain its methods in detail
  3. Explain the life cycle of an applet and the methods involved
    1. Explain how exception handling mechanism can be used for debugging a program.
    2. Is it essential to catch all types of exceptions? Justify your answer.
  4. Justify your answer in the following cases.What happens
    1. if you try to write to a random acess file that is opened only for reading ?
    2. if you try to save an object that is not serializable in an object stream?
    3. if you try to open a file for writing , but the file or device is write protected (some times called read only )?
    4. if you try to open a file for reading that doesn't exist?
SET 4 nov-2004
    1. How a for loop can be defined and used within a program ?Explain with suitable examples
    2. Explain the role of Java applets in designing a web page .
  1. Write a program which creates a window with yellow back ground color and message HOW ARE YOU?
  2. With an example show the handling of mouse events in JAVA?
  3. Differentiate event sources and event listeners in an applet with an example
  4. Define the basic purpose of exception handling. Demonstrate the coding of exception handler
SET 1 nov-2002
    1. what are the features of Java that made the language so important ?
    2. What is a class ? How do classes help us to organize our programs ?
    3. What are objects? How are they created from a class? When do we declare a member of a class static?
    1. Design a class to represent a bank acount . Include the following members.
      Data members:		Name of the depositor 
                                 				Account Number 
                                 				Type of account 
                                 				Balance amount in the account
                                 		Methods:		To assign initial values 
                                 				To deposit an amount 
                                 				To with draw an amount after checking balance 
                                 				To display the name and balance 
    2. Explain the various control structures available in Java with suitable pieces of code examples.
    1. What are the major differences and similiraties between interfaces and classes.
    2. Describe various forms of implementing interfaces. Give examples for each case.
    3. Give an example where interface can be used to support multiple inheritance.
    1. Define a package? What is the necessity of packages?
    2. How do we add class or interface to a package?
    3. Discuss various levels of access protection available for packages and their implications.
    1. What is a component object in the Java AWT?
    2. How is a container different from other types of components ?
    3. What are the five different layout manager types? Which managers use the one argument add method, and which use the method in which the first argument is a string value and the second a component?
    1. Describe the different stages inthe life cycle of an applet. Distinguish between init() and start() methods.
    2. Develop an applet that receives the numeric values from the user and display the largest of the three on the screen.
    3. Write briefly about applet display methods.
    1. How do we set priorities for threads? What are the two methods by which we may stop threads ?
    2. Develop a simple life application program to illustrate the use of multi threads.
    3. What is synchronization ? Explain how synchronized methods ar used in Java programming
    1. How are user defined exceptions are handled in Java? Explain in detail with programming examples.
    2. Create a try block that is likely to generate three types of exceptions and then incorporate necessary catch blocks to catch and handle them appropriately.
SET 2 nov-2002
    1. Explain the characteristics of Java.
    2. Why is Java known as platform independent language? How is this achieved?
    3. What are the components of Java architecture? Explain in detail.
    1. List eight basic data types used in Java? Give examples.
    2. What is type casting? Why is it required in programming ?
    3. What are different types of IF statements in Java? Illustrate with examples.
    1. Distinguish between the following terms. i)Objects and classes ii) Data abstraction and data encapsulation iii) Inheritance and polymorphism iv) Dynamic binding and message passing
    2. Discuss the different levels of access protection availabel in Java.
    3. What is the difference between overriding and over loading a method?
    1. Describe various forms of implementing interfaces. Give examples of Java code for each case.
    2. What is a package ? How do we design a package ? How do we add a class or interface to a package ?
    1. What is the difference between a frame , a window and a containers?
    2. What is the task performed by the layout manager?
    3. Explain how the mechanism of inheritance , composition and implementation of an interface are all involved in the task of attatching a layout manager to a container.
    1. What is an applet? What are the differences between an applet and an application.
    2. Write an applet to display the current date and time.
    3. What is default layout of an applet?
    1. What is an exception ? Explain the different types of exceptions
    2. Write a program to demonstrate the use of exception handling
    3. List some of the most common types of exceptions in Java. Give examples.
    1. What is a thread What is multithreading ? Explain
    2. Explain the life cycle of a thread.
    3. How to create thread? Explain in detail.
SET 3 nov-2002
    1. Write a Java program to calculate the factorial of a given integer at command line.
    2. Write the syntax and use of the following Java operators.
      i) Switch ii)Break iii)if-else-if iv)return
    1. What is type casting ? Why is it required in programming ? Give Examples.
    2. What is a consructor ? What are its special properties ? How do we invoke a constructor? Give examples
    3. Why do we declare a method abstract or final.
    1. What are the applications of wrapper class?
    2. Write a Java program that accepts a shopping list of five items from the command line and store them in a vector.
  1. Waht is an exception? How do you handle exception. Explain in detail with examples.
    1. Explain the steps involved in
      1. Developing and running a level applet
      2. Loading and running a remote applet.
    2. Develop an applet that receives three numeric values as input from the user and then display the largest of the three on the screen. Write a HTML page.
    1. How is Java's coordinate system organized?
    2. Describe the three ways of drawing polygons
    1. Create a DataInputStream for the file names ? "student.dat"
    2. Write a program to create a file stream that concatenates two existing files.
  2. Write a short note on the following
    1. Event driven programming
    2. Multi threading
    3. Interactive input and output
SET 4 nov-2002
    1. Write a program (Java) to display whether a integer entered at command line is prime or not.
    2. Write twelve bitwise operators in Java and explain their usage.
  1. Distinguish between the following terms
    1. Objects and classes
    2. Data abstraction and data encapsulation
    3. Inheritance and polymorphism
    1. Discuss the different levels of access protection available in Java.
    2. How does a string class differ from the string buffer class?
    3. What is a vector? How is it different from an array?
    1. What is a finally block? When and how is it used? Give a suitable example.
    2. Define an exception called "NomatchException " that is thrown when a string is not equal to "India" write a program that uses exception .
    1. How do applets differ from application programs?
    2. Why do applet classes need to be declared as public?
    3. Describe different stages in the life cycle of an applet.
    4. Distinguish between init() and start() methods
  2. Write applets to draw the following shapes
    1. Cylinder
    2. Cube
    3. Circle inside a square
    1. Describe the functions of the File class
    2. State the steps involved in creating a disk file .
    3. Which streams must always be used to process external files? Why?
  3. Write short note on the following
    1. Casting objects
    2. Frames
    3. Multi-threading

Enter supporting content here