Java lab questions

Share Embed Donate


Short Description

Download Java lab questions...

Description

 Java & Internet Programing lab(Part –I&II) All the programs the input must be given by the user

1.Method overloading (input from console also)

1. To find find the area area of of geomet geometric ric obje objects cts 2. Addition

Method overriding  -using super   -using dynamic method dispatch

2.Interfaces and packages(getting the input from console)

3. To sort sort the the numbe numbers rs in in a given given array array 4.

To sort sort the stri string ng in a given given array array..

5.

To find find the root rootss of an quadr quadrati aticc equatio equation n

6.

To gener generat atee n prime prime numb number erss

7.

To perform perform arithme arithmetic tic operati operations ons using using switch switch case

8.

Sum, Sum, produc productt and revers reversee of a give given n number  number 

3.Exception handling

9. Predef Predefined ined Except Exception ionss handli handling ng Examples to illustrate ArrayIndexOutOf Bound Exeption  NumberFormatException, NullPointerExeption 10. Custom Exception Exception CheckedException UncheckedException

4.Streams

11. 11. Prog Prog for  for  •

Reading input from a file and displaying it in the console



Reading input from two files files and storing it in in a third file



Read the input from the program progra m itself and write to the file



Getting input from user and storing it in an array and write into a file



Concatenation of files



Appending information to files



Word Count, Line count. Counting the occurrence of a particular string



Usage of File properties-exists,delete,available,etc

5. Threads

Producer Consumer problem 12. -Generating -Generating numbers numbers 13. -Generating -Generating characte characters rs

Advanced Java Programming Programming 6. Applets

14. -Event handling handling in buttons buttons and checkbox.

7. TCP/IP Socket

15. -msg communicati communication on from server to client. client. 8. UDP communication

16. -msg communicati communication on from server to client. client. 17. -msg communication from client to server. server. 9. JDBC 10. Servlets

18. -processing -processing a HTML HTML form 11. RMI

19. interface interface program programss(sub division 2 in core java programs)

Sample Questions 1. a. Write Write a java java program program to perform perform the arithme arithmetic tic operations operations using the the concept of  of  method overloading •

Get two inputs Integer and the output must be a float.



Get two inputs Float and the output must be an Integer.

Write a java program to perform the concept of method overriding for calculating simple interest of 3 banks A,B,C. using dynamic method dispatch Bank A’ A’s rate of interest-10%, Bank’s B rate of interest-9%, Bank’C rate of  interest -7%

Design the HTML page for a job site which con tains a form for filling a biodata of a person and it should contain a menu of various train lists

2. Write a RMI program program to perform perform arithmetic arithmetic operations. operations. Based upon the the user  choice the operation must be performed

3. Write a java java program program to find the the roots of of a quadratic quadratic equation equation using interf interface ace and  packages.



Declare a interface in package Quad1



Declare another package Quad2 and implement the interface.

4. Develop Develop a simple JDBC JDBC applicatio application n to store store the details details of an employe employeee in a table and retrieve it and display it in the console

Design a Web Web page which contains information regarding your college which contains tables, lists lists and hyperlinks. hyperlinks. (Must use use attributes)

5.

Write Wr ite a java java program program to throw throw a exception exception (checked) (checked) for for an employ employee ee details details •

If an employee name is a number, a name exception must be thrown.



If an employee age is greater than 50, an age exception must be thrown.



Or else an object must be created for the entered employee details.

6. a. Write Write a TCP/IP TCP/IP Socket program program to send send the contents contents of of a file from from server server to client.  b. Design a HTML page for railways railways which contains link link for a reservation and viewing various train details.

7. Write a java java program program to perform perform the followi following ng operations operations based based upon the choice choice entered by the user. user. 1.

Reading input from from a file(f file(f1) 1) and display displaying ing it in in the console console

2. Read the input from from the the program program itself itself and and write write to the file(f file(f2) 2) 3. Concate Concatenat nation ion of file files(f s(f1 1 and and f2) f2) f3 o

o

Appending information to file f3 Perform word count on f3.

8. a. Develop Develop a applet applet which listens listens for events of buttons buttons  b. Develop a Web page which contains information regarding a bookshop using frames, tables, lists and basic HTML tags.

9. a. Write Write a UDP UDP Socket Socket program program to send send a message message from server server to to client. client.  b. Design a HTML form for filling a biodata of a pe rson and on submission of a form a welcome message must be displayed.

10. a. Write Write a java program to solve solve producer consumer problem which generates characters using threads.  b. Design a HTML page which contains information of a library using tables with its attributes, a form for issuing a book to students and use various type of lists to display the book details .

11. Develop a web page which contains information regarding job opportunities using tables ,lists ,forms and basic HTML tags Get the biodata of the user as an input using various form fields (the form must have all the controls) and on submission of the form, a servlet is invoked to display the data in tabular column

12. a. Write Write a java program to calculate the area of 3 geometric objects operations using the concept of method overloading.  b. Write Write a java program to perform the concept of method overriding for  calculating simple interest of 3 banks A, B, C. using super mechanisms Bank A’ A’s rate of interest-10%, Bank’s B rate of interest-9%, Bank’C rate of  interest -7%

c. Design a HTML form for filling a biodata of a person and on submission of a form a welcome message must be displayed.

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF