Uploaded by vp07121

Assignment

advertisement
Core Java Programming

A Hello World Program
Create a simple Java program with Eclipse and learn to debug it.
Use eclipse to check the values in variables.




Using Variables
Public, Private, Protected
While, For, do.. while , if Loops and Switch Case
Methods and Method Parameters
Write a program to showcase different types of variables – use method overloading to add 2 integers, double, bigDecimal and String values.

Strings, String Builder, String Buffer and String Formatting
1. Write a program to concatenate, substring , replace a char at index n .
2. Write a Java Program to find the duplicate characters in a string.
String – “Rammanna”
Duplicate chars are : a, m and n


Constructors
Static , Final – variables and methods
Write a class named Address which has name, phone and company name.
Use constructor to initialize the above listed fields. Use static / final variable wherever it applies.

Encapsulation
Classes and Objects.
Create a structure of your organisation in Java.





Inheritance
extends keyword
Polymorphism
implements keyword
Interfaces and Abstract Classes
Write a program which has
-
Animal (class / interface)
Lion Class
Cat Class
Dog Class
Lion, Cat and Dog class should have inherited/polymorphic method - speak, which should be customised to Roar, Meow or bark.


Object Class - The toString and equals Method
Write a program to compare two objects and check the equality .
Arrays
Write a program to add the numbers which are on same index of two arrays
Array1 : {2,4,6,8,10}
Array2: {1,2,3,4,5}
Output Array = {3,6,9,12,15}





Casting Numerical Values
Upcasting and Downcasting
Reading Files, processing the data and Writing data to files
Handling Exceptions
Multiple Exceptions
Write a program to read a .csv with numbers in all columns . Add 2 to all the numbers and write to a new .csv file.
Throw and handle exception if it reads 0. Program should not add any number if it reads 0.
Input file Contents are
0
2,4,6,8,10
5,10,15,20,25
1,1,1,1,1
Output file Content should be
0
4,6,8,10,12
7,12,17,22,27
3,3,3,3,3
Java Collections







ArrayList
Vectors
Linked Lists
HashMap: Retrieving Objects via a Key
Write a Java Program to iterate HashMap (Using Iterators)
Sets
Deciding Which Collection to Use
Write a program to accept 2 arrays of names and return unique names
Array1 – {Anil,Suresh, Sushma, Ravi, John , Mary}
Array2 -– {Anil,Sunita, Raj, Ravi, John}
The returned list should have no duplicates.
An organisation has salaries ranging from 3 Lakhs to 5.7 Lakhs
Find the number of employees getting salaries in range of 3.0 to 3.9 and 5.0 to 5.9
Input file
Anil , 5.6
Suresh , 3.5
Sushma, 4.2
Ravi, 3.95
John , 4.0
Mary,3.2
Output :
3 Employees and 1 Employee
Learn basics of :






Using Generics
Generics and Wildcards
Anonymous Classes
Inner Classes
Enums
The Scanner class
JDBC
Write a program to connect to database and execute a select query.
Read resultset data and store in an object and print the values on console.
SQL
Select Query
Update Query
Select with conditions from 2 tables
Select with join condition on 2 tables
Download