Java Lab Cycle-1
Java Lab Cycle-1
Master of Computer Applications
Union Christian College, ALUVA
(Affiliated to M.G University & Approved by AICTE)
constructor to initialize the name, email and gender with the given
values.Define get and set methods- setEmail(), getName(), getEmail(), and
getGender().
(There are no setters for name and gender, as these properties are not
designed to be changed).Define another method toString() method that
returns "name (gender) at email", e.g., "John(m) at john@gmail.com".
Implement the concept of encapsulation.
16. Create a class name Toys with two place holders area () and perimeter ().
By using the properties of the Toys class calculate the area and perimeter of
bus, ball and 3 sided toy.
17. Implement Dynamic method dispatch to calculate the volume of at least 3
different shapes.
18. Find the number of characters in each string that is passed as command line
argument and also find the total number of vowels in it.
19. Define one class that contains placeholders for getting the personal details
of employees(Name, DOB, Address,Blood Group etc). Create two interfaces that
contain methods for accepting professional details(Designation, date of
joining,salary etc) and loan details(Loan type , loan A/C no,sanction date,
sanction amount etc) . Implement multiple inheritance and display all details
of n employees.
20. Create a package student which contains personal and educational details .
Import
this package and print the details of n students in tabular form.
23.Create multiple threads and use all possible methods associated with Threads.
(isAlive(),yield(),start(),sleep(),stop()).
25. Perform some file operations and also perform read the content of a file and
write
it to another file. After writing , insert some more contents to the file and
copy
to another file.