Sie sind auf Seite 1von 39

Core Java Lab Assignments

Lecture No -1 Assignment No-1


Objective Write a program to display string on screen Commands to be used 1. Output method Output

Core Java Lab Assignments

Lecture No -2 Assignment No-1


Objective Write a program to find the negative positive number and convert into absolute number. Commands to be used 1. IfElseNested Output

Core Java Lab Assignments

Lecture No -2 Assignment No-2


Objective Write a program to accept the month & find no of days in the given month using switch case Commands to be used 1. Switch Case Output

Core Java Lab Assignments

Lecture No -3 Assignment No-1


Objective Write a program to find the factorial of a given number using for loop Commands to be used 1. For Loop Output

Core Java Lab Assignments

Lecture No -3 Assignment No-2


Objective Write a program to find the square root of number Commands to be used 1. While Loop Output

Core Java Lab Assignments

Lecture No -3 Assignment No-3


Objective Write a program to search a character Commands to be used 1. Continue Output

Core Java Lab Assignments

Lecture No -4 Assignment No-1


Objective Create a class called circle having field radius and method to calculate area, perimeter and diameter Commands to be used 1. Class Output

Core Java Lab Assignments

Lecture No -3 Assignment No-2


Objective Write a program to store the characters in variable Commands to be used 1. Array Output

Core Java Lab Assignments

Lecture No -5 Assignment No-1


Objective Create a class triangle having two constructors one taking length of the equilateral triangle and another constructor taking base & height, make methods to calculate the area of triangle (hint: area formula for equilateral triangle is length* sqrt(3)/4) Commands to be used 1. Constructor Overloading Output

Core Java Lab Assignments

Lecture No -5 Assignment No-2


Objective Write a class Maths having method pow (int n) to find the square of n and overload this method by two parameters i.e. pow(int n, int p) to find the n raised to p Commands to be used 1. Method Overloading Output

10

Core Java Lab Assignments

Lecture No -6 Assignment No-1


Objective Create a class Triangle and inherit this class in Rhombus taking length of the diagonal in the constructor and override the method area of the Triangle class to find the area of the Rhombus Commands to be used 1. Inheritance 2. Method Overriding Output

11

Core Java Lab Assignments

Lecture No -7 Assignment No-1


Objective Create an abstract class polygon having field length and abstract method area() to calculate area of the polygon. Now create two classes triangle & square inheriting the abstract class and implementing the area() method (note: length of the all sides are same) Commands to be used 1. Abstract Class Output

12

Core Java Lab Assignments

Lecture No -8 Assignment No-1


Objective Create an interface shape having method area() and perimeter(). Now create a class triangle implementing the interface shape Commands to be used 1. Interface Output

13

Core Java Lab Assignments

Lecture No -8 Assignment No-2


Objective Create a package shapes having interface shape with method area() and perimeter(). Now create a class triangle implementing the interface shape Commands to be used 1. Package Output

14

Core Java Lab Assignments

Lecture No -9 Assignment No-1


Objective Create a class EmailValidator having field email with private access private and methods setEmail() & getEmail to assign and retrieve the value of field email. In the setEmail() method check whether email id value is valid or not if not throw the custom exception, and handle exception using try catch. Commands to be used 1. Throw 2. Throws 3. Try Catch Output

15

Core Java Lab Assignments

Lecture No -10 Assignment No-1


Objective Write a program to print of the characters of string Hello World Java one by one with 100 millisecond interval gap; it should be like your typing it Commands to be used 1. Threading Output

16

Core Java Lab Assignments

Lecture No 11 Assignment No-1


Objective Write a program to copy the content of one file into another file Commands to be used 1. File Handling Output

17

Core Java Lab Assignments

Lecture No -12 Assignment No-1


Objective Create a class called Contact having fields name, tel, mobile, email and an ArrayList of data type Contact. Now create a program to accept the list of contact details from user and hold details in ArrayList. At the end save all details to a file Commands to be used 1. ArrayList Output

18

Core Java Lab Assignments

Lecture No -12 Assignment No-2


Objective Write a Hastable to store the contact numbers, store name in key and mobile number in value. Now write a program to accept name and display the mobile number Commands to be used 1. Hashtable Output

19

Core Java Lab Assignments

Lecture No -13 Assignment No-1


Objective Write a program to find the occurrence of a given string in the given file Commands to be used 1. File Handling 2. String functions Output

20

Core Java Lab Assignments

Lecture No -13 Assignment No-2


Objective Write a program to find age of the person from date of birth using date function Commands to be used 1. Date Function 2. String functions Output

21

Core Java Lab Assignments

Lecture No -14 Assignment No-1


Objective Create an Applet program to display below output using paint method Commands to be used 1. Paint method 2. Graphics object Output

22

Core Java Lab Assignments

Lecture No -15 Assignment No-1


Objective Create an Applet program to display a string follow mouse on the move event of the mouse the text follow the position of the mouse pointer Commands to be used 1. MouseMotionListener Output

23

Core Java Lab Assignments

Lecture No -16 Assignment No-1


Objective Create a simple Calc program using Frame Commands to be used 1. Frame Output

24

Core Java Lab Assignments

Lecture No -16 Assignment No-2


Objective Create a simple Frame having four buttons aligned edges of the form and a textfield in the center, on click of the add code to change the color of the text in the textfield Commands to be used 1. Frame Output

25

Core Java Lab Assignments

Lecture No -17 Assignment No-1


Objective Create a login form as shown below using JFrame and on the click login button verify the username and password from a text file containing user database Commands to be used 1. JFrame 2. File Handling Output

26

Core Java Lab Assignments

Lecture No -18 Assignment No-1


Objective Create JFrame having a label and Radio buttons for selecting font color and checkboxes for selecting font style Commands to be used 1. JFrame 2. JRadioButton 3. JCheckBox Output

27

Core Java Lab Assignments

Lecture No -19 Assignment No-1


Objective Create a Font dialog box as shown below using JComboBox, Jlist and JScrollpane Commands to be used 1. JComboBox 2. JList 3. JScrollPane

28

Core Java Lab Assignments

Lecture No -20 Assignment No-1


Objective Create a JFrame having JLabel and JSlider to change the font size of the text in JLabel Commands to be used 1. JSlider

29

Core Java Lab Assignments

Lecture No -21 Assignment No-1


Objective Create a JFrame having File Menu containing Menu items Add User, Change Password, Exit Commands to be used 1. JMenu Output

30

Core Java Lab Assignments

Lecture No -22 Assignment No-1


Objective Create a JFrame having a toolbar with open button and textfield, clicking the button opens JFileChooser for selecting the image file and selected gets displayed on the form and textfield shows the path of the file Commands to be used 1. JToolbar, JFileChooser Output

31

Core Java Lab Assignments

Lecture No -23 Assignment No-1


Objective Create a column chart showing population in year 2005,2006,2007,2008 using JProgressBar Commands to be used 1. JProgressBar Output

32

Core Java Lab Assignments

Lecture No -24 Assignment No-1


Objective Create a JFrame having JTabbedPane with three tabs and display different images in the tabs Commands to be used 1. JTabbedPane Output

33

Core Java Lab Assignments

Lecture No -26 Assignment No-1


Objective Create an image animation of given image from right to left Commands to be used 1. Image Animation Output

34

Core Java Lab Assignments

Lecture No -27 Assignment No-1


Objective Create an image animation of given image from right to left and add play toggle button clicking on it starts the animation and plays a background sound Commands to be used 1. Image Animation 2. Sounds Output

35

Core Java Lab Assignments

Lecture No -29 Assignment No-1


Objective Create a client & server program using sockets, client program will send filename of remote server and server will read it and it will send the content of the file Commands to be used 1. Socket 2. File Handling Output

36

Core Java Lab Assignments

Lecture No -30 Assignment No-1


Objective Create a JDBC program to retrieve the data from Customer Table and display it on JTable Commands to be used 1. JDBC 2. JTable Output

37

Core Java Lab Assignments

Lecture No -31 Assignment No-1


Objective Create a Data Entry Form for inserting, updating and deleting data from Customer Table Commands to be used 1. JDBC Output

38

Core Java Lab Assignments

Lecture No -32 Assignment No-1


Objective Create a program to display the customer details in XML file on to JTable Commands to be used 1. XML Output

39

Das könnte Ihnen auch gefallen