0% found this document useful (0 votes)
580 views38 pages

Java Daily Task

hi

Uploaded by

MEERA SUPERSTORE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
580 views38 pages

Java Daily Task

hi

Uploaded by

MEERA SUPERSTORE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Day 1 Class,method,object

[Link] Introduction
[Link],Method,Object
[Link] package and Different package
[Link]

QUESTIONS(Theory):
[Link] is platform independent?
[Link] is open source?
[Link] between JDK,JRE,JVM?
[Link] we go for java?
[Link] is the latest version of JDK and which version you are using in your project?
[Link] is the latest version of eclispe and which version you are using in your project?
[Link] between c++ and java?
[Link] of java?
[Link] type of tool you are using in your project to execute java?
[Link] between class,method,object?
[Link] object stores?
[Link] to access one class method in to another package in different package?
[Link] is encapsulation?
[Link] standard to create project,class,method,package and object ?
[Link] gives Java it's "write once and run anywhere" nature?

QUESTIONS(Programs):
QUESTION 1:
Project :EmployeeDetails
Package :[Link]
Class :Employee
Methods :empId(),empName(),empDob(),empPhone(),empEmail(),empAddress()
Description:
Create an object for employee class and call above methods also follow the all coding
standards.

QUESTION 2:
Project :GreensAddress
Package :[Link]
Class :GreensTech
Methods
:greensOmr(),greensAdayar(),greensTambaram(),greensVelacherry(),greensAnnaNagar()
Description:
Create an object for GreensTech class and call above methods also follow the all coding
standards.

QUESTION 3:
Project :CompanyDetails
Package :[Link]
Class :CompanyInfo
Methods :companyName(),companyId(),companyAddress()
Description:
Create an object for CompanyDetails class and call above methods also follow the all coding
standards.

QUESTION 4:
Project :MyPhone
Package :[Link]
Class :PhoneInfo
Methods :phoneName(),phoneMieiNum(),Camera(),storage(),osName()
Description:
Create an object for PhoneInfo class and call above methods also follow the all coding
standards.

QUESTION 5:
Project :LanguageDetails
Package :[Link]
Class :LanguageInfo
Methods :tamilLanguage(),englishLanguage(),hindiLanguage()
Class :StateDetails
Methods :southIndia(),northIndia()
Description:
Create an object for LanguageInfo and StateDetails inside the StateDetails class and call both
classes methods also follow the all coding standards.

QUESTION 6:
Project :EmployeeInformation
Package :[Link]
Class :Employee
Methods :empName()

Package :[Link]
Class :Company
Methods :companyName()

Package :[Link]
Class :Client
Methods :clientName()

Package :[Link]
Class :Project
Methods :projectName()

Description:
Create an object for all 4 classes inside the Employee class and call all classes methods also
follow the all coding standards.

QUESTION 7:
Project :PhoneDetails
Package :[Link]
Class :ExternalStorage
Methods :size()
Class :InternalStorage
Methods :processorName(),ramSize()
Description:
Create an object for ExternalStorage and InternalStorage inside the InternalStorage class and
call both classes methods also follow the all coding standards.

QUESTION 8:
Project :CollegeInformation
Package :[Link]
Class :College
Methods :collegeName(),collegeCode(),collegeRank()

Class :Student
Methods :studentName(),studentDept(),studentId()

Class :Hostel
Methods :hostelName()

Class :Dept
Methods :deptName()
Description:
Create an object for all 4 classes inside the College class and call all classes methods also
follow the all coding standards.

QUESTION 9:
Project :VehicleInformation
Package :[Link]
Class :Vehicle
Methods :VehicleNecessery()

Package :[Link]
Class :TwoWheller
Methods :bike(),cycle()

Package :[Link]
Class :ThreeWheeler
Methods :Auto()

Package :[Link]
Class :FourWheeler
Methods :car(),bus(),lorry()
Description:
Create an object for all 4 classes inside the Vehicle class and call all classes methods also
follow the all coding standards.

QUESTION 10:
Project :TransportInformation
Package :[Link]
Class :Transport
Methods :TransportForm

Package :[Link]
Class :Road
Methods :bike(),cycle(),bus(),car()

Package :[Link]
Class :Air
Methods :aeroPlane(),heliCopter()

Package :[Link]
Class :Water
Methods :boat(),ship()
Description:
Create an object for all 4 classes inside the Transport class and call all classes methods also
follow the all coding standards.

QUESTION 11:
Project :NetworkInformation
Package :[Link]
Class :Wifi
Methods :wifiName()

Class :MobileData
Methods :dataName()

Class :Lan
Methods :lanName()

Class :Wireless
Methods :modamName()
Description:
Create an object for all 4 classes inside the Wifi class and call all classes methods also follow
the all coding standards.

Day 2_Inheritance,Scanner,Datatype,access specifier

[Link]
[Link] specifiers
[Link] types
[Link] class

QUESTIONS(Theory)
[Link] is mean by inheritance?
[Link] of inheritance and explain all types?
[Link] is mean by multiple inheritance,why java won't support multiple inheritance?
[Link] between hybrid and hierachical inheritance?
[Link] is the use of access specifier and types?
[Link] between public and protected?
[Link] is mean by Wrapper class?
[Link] is default value of String?
[Link] is difference between primitive and non primitive datatypes?
[Link] is default package in java?
[Link] is the super class of all java class?
[Link] is use of scanner class?
[Link] are the different methods available in Scanner class?
[Link] class is under which package?
[Link] between next() and nextLine()?

QUESTIONS(Programs)
QUESTION 1:
Description: Using Scanner class get the below details
empId
empName
empEmail
empPhoneno
empSalary
empGender
empCity

QUESTION 2:
Description: Using Scanner class get the below details
studentId
studentName
Mark1
Mark2
Mark3
Mark4
Mark5
:Find the total and average of marks

QUESTION 3:
package name: [Link]
Project name: LanguageDetails
Class name : Languageclass
Methods : alllanguage

package name: [Link]


Project name: LanguageDetails
Class name : Tamil
Methods : tamillanguage

package name: [Link]


Project name: LanguageDetails
Class name : English
Methods : englishlanguage

package name: [Link]


Project name: LanguageDetails
Class name : Telgu
Methods : telgulanguage
Description:
create above 4 packages and call all your class methods into the Languageclass using
multilevel inheritance.

QUESTION 4:
package name: [Link]
Project name: SouthIndia
Class name : India
Methods : india

package name: [Link]


Project name: SouthIndia
Class name : TamiladuN
Methods : tamillanguage

package name: [Link]


Project name: SouthIndia
Class name : kerala
Methods : Malayalam

package name: [Link]


Project name: SouthIndia
Class name : AndhraPradesh
Methods : telugu
Description:
create above 4 packages and call all your class methods into the India using multilevel
inheritance.

QUESTION 5:
Project :CollegeInformation
Package :[Link]
Class :College
Methods :collegeName(),collegeCode(),collegeRank()
Class :Student
Methods :studentName(),studentDept(),studentId()
Class :Hostel
Methods :HostelName()
Class :dept
Methods :deptName()
Description:
create above 4 class and call all your class methods into the Student using multilevel
inheritance.

QUESTION 6:
Project :COmputer
Class :Computer
Methods :computerModel()
Class :Desktop
Methods :desktopSize()
Description:
create above 2 class and call all your class methods into the Desktop using single inheritance.

QUESTION 7:
Project :LanguageDetails
Package :[Link]
Class :LanguageInfo
Methods :tamilLanguage(),englishLanguage(),hindiLanguage()

Class :StateDetails
Methods :southIndia(),northIndia()
Description:
create above 2 class and call all your class methods into the LanguageInfo using single
inheritance.

QUESTION 8:
Description: Using Scanner class get the below details
StudentId
StudentName
StudentEmail
StudentPhoneno
StudentDept
StudentGender
StudentCity

QUESTION 9:
Project :BankDetails
Package :[Link]
Class :BankInfo
Methods :saving(),fixed()

Class :AxisBank
Methods :deposit()
Description:
create above 2 class and call all your class methods into the BankInfo using single
inheritance.

QUESTION 10:
Project :CompanyDetails
Package :[Link]
Class :Company
Methods :companyName()
Package :[Link]
Class :Client
Methods :clientName()
Description:
create above 2 packages and call all your class methods into the Comapany using single
inheritance.
QUESTION 11:
Project :EducationInformation
Package :[Link]
Class :Education
Methods :ug(),pg()

Class :Arts
Methods :bsc(),bEd(),bA(),bBA()

Class :Engineering
Methods :bE(),bTech()

Class :Medicine
Methods :physiyo(),dental(),mbbs()
Description:
create above 4 class and call all your class methods into the Education using multilevel
inheritance.

Day 3_Polymorphism,Abstraction
[Link]
[Link]

QUESTIONS(Theory)
[Link] is mean by polymorphism?
[Link] between method overloading and method overriding?
[Link] is mean by Abstraction?
[Link] between Abstract class and interface?
[Link] is mean by abstract method?
[Link] we create object for abstract class?
[Link] interface,can we make method as static?
[Link] interface,can we make method as final?
[Link] will achieve multiple inheritance in java,write a code for that?

QUESTIONS(Programs)
QUESTION 1:
Find the answer for below questions and tell whether it is possible or not?
I implements I
I implements C
I implements A
I extends I
I extends C
I extends A

C implements I
C implements C
C implements A
C extends I
C extends C
C extends A
A implements I
A implements C
A implements A
A extends I
A extends C
A extends A

A-abstract class
C-class
I- interface

QUESTION 2:
Project :EmployeeDetails
Package :[Link]
Class :Employee
Methods :empId()
Description
You have to overload the method empId() based on different datatype in arguments.
QUESTION 3:
Project :CompanyDetails
Package :[Link]
Class :CompanyInfo
Methods :companyName()
Description
You have to overload the method companyName() based on different Number of arguments.
QUESTION 4:
Project :MyPhone
Package :[Link]
Class :Phone
Methods :phoneInfo()

Description
You have to overload the method phoneInfo() based on different datatype order in arguments.
QUESTION 5:
Project :GreensAddress
Package :[Link]
Class :GreensTech
Methods :greensOmr()
Description
You have to overload the method greensOmr() based on order,type,number.

QUESTION 6:
Project :BankDetails
Package :[Link]
Class :BankInfo
Methods :saving(),fixed(),deposit()
Class :AxisBank
Methods :deposit()
Description:
You have to override the method deposit in AxisBank.
QUESTION 7:
Project :EducationInformation
Package :[Link]
Class :Education
Methods :ug(),pg()
Class :Arts
Methods :bSc(),bEd(),bA(),bBA(),ug(),pg()
Description:
You have to override the method ug(),pg() in Arts.

QUESTION 8:
Project :UniversityInformation
Package :[Link]
Class :University
Methods :ug(),pg()
Class :College
Methods :ug(),pg()
Description:
ug(),pg() is just a templete in University class and You have to override the method ug(),pg()
in College class.

QUESTION 9:
Project :BikeInformation
Package :[Link]
Interface :Bike
Methods :cost(),speed()
Class :Ktm
Methods :cost(),speed()

Description:
cost(),speed() is just a templete in Bike Interface and You have to override the method
cost(),speed() in Ktm class.
QUESTION 10:
Project :Computer
Interface :HardWare
Methods :hardwareResources()

Interface :Software
Methods :softwareResources()

Class :Desktop
Methods :desktopModel()
Description:
create 2 Interface and archieve multiple inheritance.
Day 4_ControlStatements
[Link]/else if
[Link](for,while,do-while)
[Link] case
[Link]/continue

QUESTIONS(Theory)
[Link] is difference between break and continue?
[Link] we can use continue statement in switch?
[Link] is mean by control statments and types?
[Link] is mean by for loop?
[Link] you explain about for loop execution process?
[Link] is difference between while and do-while?
[Link] is the use of default keyword in switch?
[Link] between for and while loop?

QUESTIONS(Find the output)


QUESTION 1:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 100; i++) {
if (i == 5) {

}
[Link](i);
}}}

QUESTION 2:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 10; i++) {
if (i == 5) {
break;
}
[Link](i);
}}}

QUESTION 3:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 10; i++) {
if (i == 5) {
continue;
}
[Link](i);
}}}
QUESTION 4:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3; j++) {
[Link](j);
}}}}

QUESTION 5:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 3; j++) {
[Link](i);
}}}

QUESTION 6:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= i; j++) {
[Link](j);
}}}

QUESTION 7:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = i + 1; j <= 3; j++) {
[Link](j);
}}}

QUESTION 8:
package [Link];
public class Hello {
public static void main(String[] args) {
for (int i = 1; i <= 3; i++) {
for (int j = i + 1; j <= i; j++) {
[Link](j);
}}}}

QUESTION 9:
package [Link];
public class Hello {
public static void main(String[] args) {
int i=5;
if (i == 5) {
break;
}
[Link](i);
}}

QUESTION 10:
package [Link];
public class Hello {
public static void main(String[] args) {
int i=5;
if (i == 5) {
continue;
}
[Link](i);
}}

QUESTIONS(Programs)
QUESTION 1:
Description: Write Java program to allow the user to input his/her age.
Then the program will show if the person is eligible to vote.
A person who is eligible to vote must be older than or equal 1 to 18 years old.
Example:
Input = 10
Output = print not eligible.

QUESTION 2:
Description: Write a program to find even or odd number
Example:
Input = 10
Output = Even

QUESTION 3:
Description: Write a program to print even number from 1 to 100
Example:
Output = 2,4,....100

QUESTION 4:
Description: Find the sum of odd number 1 to 100
Example:
Output = 2500
QUESTION 5:
Description: Count of even number 1 to 100
Example:
Output = 50
QUESTION 6:
Description: Write a program to find the factorial of a number.
Example:
Input = 5
Output = 120
QUESTION 7:
Description: Write a program to print the fibonacci series of a number 1 to 100.
Example:
Output = 0,1,1,2,3,5.....

QUESTION 8:
Description: Find prime number or not.
Example:
Input = 11
Output = prime number

QUESTION 9:
Description : Print the below patterns using for loop.
Output:
1
12
123
1234
12345
123456
1234567
-----------------------
*
* *
* * *
* * * *
* * * * *
--------------------------
*
**
***
****
*****
-----------------------------

QUESTION 10:
Description: Find Amstrong number or not
Example:
Input = 153
Output = Amstrong number
QUESTION 11:
Description: Reverse the number
Example:
Input = 123
Output = 321
QUESTION 12:
Description: Count of the number
Example:
Input = 123
Output = 3
QUESTION 13:
Description: Sum of the number
Example:
Input = 123
Output = 6

QUESTION 14:
Description: Verify the number is palindrome number not
Example:
Input = 141
Output = Palindrome

DAY 5 Constructor,Types of variables,Static and final


[Link] and types
[Link] and super
[Link] of var
[Link]/final

QUESTIONS(Theory)

[Link] is mean by constructor and types?


[Link] the types of variable
[Link] constructors have any return type?
[Link] for creating constructor?
[Link] are the rules for defining a constructor?
[Link] a return type is not allowed for constructor?
[Link] we declare constructor as 'private'?
[Link] a compiler given constructor is called as default constructor?
[Link] is constructor chaining and how can it be achieved in Java?
[Link] we use this() and super() in a method?
[Link] are the common uses of "this" keyword in java?
[Link] of variable?
[Link] is meant by local variable,instance variable,class/static variable?
[Link] is mean by static keyword in java?
[Link] we override static method in java?
[Link] we overload static method in java?
[Link] is mean by static variable?
[Link] is mean by static method?
[Link] is mean by final keyword and what's happend when we declare final as in
class,method,variable?
[Link] is difference between final and finalize keyword?
[Link] local,static and class variables stores in jvm?

QUESTIONS(Find the below Output)


QUESTION 1:
package [Link];
public class A {
public A() {
this("JAVA");
[Link]("Default const...");
}
public A(int id) {
this(3456.5678f);
[Link](id);
}
public A(String name) {
this(12);
[Link](name);
}
public A(float sal) {
[Link](sal);
}
public static void main(String[] args) {
A a = new A();
}}

QUESTION 2:
package [Link];
public class A extends B{
public A() {
[Link]("Default const...");
}
public static void main(String[] args) {
A a = new A();
}
}
package [Link];
public class B {
public B() {
[Link]("Super class");
}}

QUESTION 3:
package [Link];
public class A extends B{
public A() {
[Link]("Default const...");
}
public static void main(String[] args) {
A a = new A();
}
}
package [Link];
public class B {
public B() {
[Link]("Super class");
}
public B(int id) {
[Link](id);
}
QUESTION 4:
package [Link];
public class A extends B {
public A() {
super(12);
[Link]("Default const...");
}
public static void main(String[] args) {
A a = new A();
}}
package [Link];
public class B {
public B() {
[Link]("Super class");
}
public B(int id) {
[Link](id);
}}

QUESTION 5:
package [Link];
public class B {
public B(int id) {
[Link](id);
}}
package [Link];
public class A extends B {
public A() {
super(12);
[Link]("Default const...");
}
public static void main(String[] args) {
A a = new A();
}}

QUESTION 6:
package [Link];
public class A extends B {
public A() {
[Link]("Default const...");
}
public static void main(String[] args) {
A a = new A();
}}
package [Link];
public class B {
public B(int id) {
[Link](id);
}}
DAY 6 String
[Link] functions
[Link] String
[Link] Literal String
[Link] String
[Link] String

QUESTIONS(Theory)
[Link] is mean by string?
[Link] to find length of the string?
[Link] to find partcular character in string?
[Link] to split the string?
[Link] is difference between literal String and non literal string?
[Link] is mutable and immutable string?
[Link] between stringbulider and stringbuffer?
[Link] name to identify memory location?
[Link] are the string functions available in java?
[Link] is difference between charAt() and contains() method?
[Link] is the return type of compareTo()
[Link] the Literal String and non literal String stores?
[Link] is mean by ASCII value?

QUESTIONS(Programs)
QUESTION 1:
Description: Find the length of the below string
String 1: GreensTechnology
String 2: SeleniumAutomationtool
String 3: velmurugan
String 4: j a v a p r o g r a m
String 5: 9095484678

QUESTION 2:
Description: Find the particular character index in the given string
String 1: GreensTechnology
Find the last index of o
String 2: SeleniumAutomationtool
Find the index of o
String 3: Velmurugan
Find the index of n
String 4: j a v a p r o g r a m
Find the last index of (emptyspace)
String 5: 9095484678
Find the index of 8

Question 3:
Description: Find the particular character in the given string
String 1: GreensTechnology
print the character h
String 2: SeleniumAutomationtool
print the character o
String 3: velmurugan
print the character u
String 4: j a v a p r o g r a m
print the character p
String 5: 9095484678
print the character 7

QUESTION 4:
Description : Get two input from user and check the equality
: print in the output whether it is Equal or not
Example:
Input :
String 1 : Java
String 2 : Java
Example:
Input :
String 1 : Java
String 2 : java

Example:
Input :
String 1 : Green Technology
String 2 : GreenTechnology.

Example(use equalsIgnoreCase):
Input :
String 1 : Java
String 2 : java

Example(use equalsIgnoreCase) :
Input :
String 1 : Nisha
String 2 : nisha
QUESTION 5:
QUESTION 5.1:
Description: Get the email id from the user and verify '@' is present or not?
Example:
Input = velmurugank451@[Link]
Output = valid email id
QUESTION 5.2:
Description:Get the address from the user and verify "pincode" is present or not?
Example:
Input = 5-35-2a,venkatesh nivas,Aruppukottai
Output = invalid address
QUESTION 5.3:
Description:Get the email from the user and verify '@' is present or not and return true or
false?
Example:
Input = Nishakerala24@[Link]
Output = True/False
QUESTION 5.4:
Description:Get the phonenumber from the user and verify any character is present or not .
If character is present return invalid number
Example:
Input = 90954a6o78
Output = False

QUESTION 6:
Description:Get the phonenumber from the user .
If phonenumber exceeds greater than 10 then return invalid number
Example:
Input = 89034256972365
output = invalid
Example 2:
Input = 9095484678
Output = valid

QUESTION 7:
QUESTION 7.1:
Description:Given string as "Welcome to java class" and replace java into sql.
Example:
Input = Welcome to class java
output = Welcome to class sql

QUESTION 7.2:
Description:Given string as "Greens Adayar"and replace Adayar into Omr.
Example:
Input = Greens Adayar
Output = Greens Omr

QUESTION 7.3:
Description: Given String as "Welcome to java class" and Replace space into '#'
Example:
input:Welcome to java class
output:Welcome#to#java#class

QUESTION 7.4:
Description:Get the email from the user and verify "gmail" is present or not.
If present replace that gmail into yahoo
Example:
Input = Nishakerala24@[Link]
Output = Nishakerala24@[Link]

QUESTION 7.5:
Description:Get the address from the user and verify "pincode" is present or not.
If present replce the pincode with empty space
Example:
Input = 5-35-2a,venkatesh nivas,Aruppukottai,pincode-626101
Output = 5-35-2a,venkatesh nivas,Aruppukottai
QUESTION 8
QUESTION 8.1
Description:Get the input from the user and print that word in lowercase
Example:
Input = NISHANTHI
Output = nishanthi

QUESTION 8.2
Description:Get the input from the user and print that word in Uppercase
Example:
Input = nishanthi
Output = NISHANTHI

QUESTION 8.3
Description:Convert all small letter and into capital letter
Example:
Input = WelcomE
Output = wELCOMe

QUESTION 8.4
Description:Find the number of uppercase count and lowercase count in the given String
Example:
Input = WelComeToJava
Output:
UpperCase=4
LowerCase=9

QUESTION 9
QUESTION 9.1
Description: Given String as "Welcome to java class" and verify whether the given string
startsWith welcome
Example:
Input = Welcome to class java
output = True

QUESTION 9.2
Description: Given String as "Hai i am nisha" and verify whether the given string startsWith
welcome
Example:
Input = Hai i am nisha
output = False

QUESTION 9.3
Description: Given String as "Welcome to java class" and verify whether the given string
endsWith class
Example:
Input = Welcome to java class
output = True
QUESTION 9.4
Description: Given String as "Welcome to java class" and verify whether the given string
endsWith java
Example:
Input = Welcome to java class
output = False

QUESTION 9.5
Description: Given String as "Welcome to java class" and verify whether the string is empty
or not
Example:
Input = Welcome to java class
output = False

QUESTION 9.6
Description: Given String as "" and verify whether the string is empty or not
Example:
Input = ""
Output = False

QUESTION 10
Description : Get two input from user and Compare
Example
String 1 : Nisha
String 2 : nisha
Example
String 1 : Nia
String 2 : nisha

QUESTION 11
QUESTION 11.1
Description : Generate the two literal string and find the identityHashCose()
Example
String 1 : Nisha
String 2 : Nisha

QUESTION 11.2
Description : Generate the two non literal string and find the identityHashCose()
Example
String 1 : Nisha
String 2 : Nisha

QUESTION 11.3
Description : Generate the three non literal string and find the identityHashCose()
Example
String 1 : Nisha
String 2 : Rengan
String 3 : NishaRengan
QUESTION 11.4
Description : Generate the three literal string and find the identityHashCose()
Example
String 1 : Nisha
String 2 : Rengan
String 3 : NishaRengan

QUESTION 12
QUESTION 12.1
Description: Given String as "Welcome to java class" and split it by space.
Example:
Input :Welcome to java class
Output:
Welcome
to
java
class

QUESTION 12.2
Description: Given String as "Welcome to java class" and split it by l
Example:
Input :Welcome to java class
Output:
We
come to java c
ass

QUESTION 13
QUESTION 13.1
Description: Given String as "Welcome to java class" and generate a substring.
Example:
Input :Welcome to java class
Output:
Welcome

QUESTION 14
Example:
Description: Given String as "Welcome" and the number of consonant count and vowels
count
Example:
Input = Welcome
output:
vowels = 3
consonant = 4

QUESTION 15:
Description: Find the count of caps,small,number and special character in given string
Example:
Input : Welcome To Java class @123
Output
caps count :3
small count :15
number count:3
Special char:5

QUESTION 16
Description: Replace all vowels char into '@'
Example:
Input = Welcome
Output = W@lc@m@

DAY 7 Array,Collection,List
[Link]
[Link] Introduction
[Link](ArrayList only)

QUESTIONS(Theory)
[Link] do you mean by an array and How to create an Array?
[Link] you change size of array once created?
[Link] it legal to initialize an array int i[] = {1, 2, 3, 4, 5}
[Link] and disadvantages of Array?
[Link] we change the size of an array at run time?
[Link] you declare an array without assigning the size of an array?
[Link] is the default value of Array?
[Link] to print element of Array?
[Link] to compare Two Arrays?
[Link] to sort an Array?
[Link] we declare array size as a negative number?
[Link] we add or delete an element after assigning an array?
[Link] we use Generics with the array?
[Link] is collection and explain about types?
[Link] is the difference between ArrayList and Vector?
[Link] is the difference between ArrayList and LinkedList?
[Link] to convert Array to List and List to Array

QUESTIONS(Find the below Output)


QUESTION 1:
Description : Write a Java program to sum values of an array
Input a[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Output = 55

QUESTION 2:
Description : Write a Java program to calculate the average value of array elements.
Input a[]= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
Output = average = 7.0
QUESTION 3:
Description : Write a Java program to remove duplicates from array
Input a[]= {10,10,20,50,60,80,60,50}
Output a[]= {10,20,50,60,80}
QUESTION 4:
QUESTION 4.1:
Description : Create a new ArrayListlist with values and find the length of it
Input : List = 10,20,30,90,10,10,40,50

QUESTION 4.2:
Description : Create a new LinkedListlist with values and find the length of it
Input : List = 100,200,300,400,500,600,700

QUESTION 4.3:
Description : Create a new vector with values and find the length of it
Input : List = 105,205,305,405,505,605,705,805

QUESTION 4.4:
Description : Create a new LinkedListlist with values and find the size() of it.
Input : List = 100,200,300,400,500,600,700

QUESTION 5:
QUESTION 5.1:
Description : Get the first index value of 10
Input: List = 10,20,30,90

QUESTION 5.2:
Description : Get the last index value of 10
Input: List = 10,20,30,90,10,10,40,50

QUESTION 5.3:
Description : Get the index value of 50
Input: List = 10,20,30,90,10,10,40,50

QUESTION 5.4:
Description : Get the index value of 90
Input: List = 10,20,30,90,10,10,40,50

QUESTION 5.5:
Description : Get the each index value of 10 present in below list
Input: List = 10,20,30,90,10,10,40,50,10

QUESTION 5.6:
Description : Get the each index value of 70 present in below list
Input: List = 10,20,30,90,10,10,40,50,10

QUESTION 6:
QUESTION 6.1:
Description : Get the value present at 2nd index
Input: List = 10,20,30,40,50,60

QUESTION 6.2:
Description : Get the value present at 4th index
Input: List = 100,200,300,400,500,600,700
QUESTION 6.3:
Description : Get the value present at 8th index
Input: List = 105,205,305,405,505,605,705,805

QUESTION 6.4:
Description : Get the each value of list by using normal for loop
Input: List = 105,205,305,405,505,605,705,805

QUESTION 6.5:
Description : Get the each value of list by using enhanced for loop
Input: List = 105,205,305,405,505,605,705,805

QUESTION 7:
QUESTION 7.1:
Description : Remove the value present at 2nd index
Input: List = 10,20,30,40,50,60

QUESTION 7.2:
Description : Remove the value present at 10th index
Input: List = 10,20,30,90,10,10,40

QUESTION 7.3:
Description : Remove the last value of 10 present in the list
Input: List = 10,20,30,90,10,10,40

QUESTION 8:
QUESTION 8.1:
Description : Add a value 50 in the 2nd index and display the list after adding.
Input : List = 10,20,30,90,10,10,40,50

QUESTION 8.2:
Description : Add a value 70 at the end of the list
Input : List = 10,20,30,90,10,10,40,50

QUESTION 8.3:
Description : Add a value 80 at the 8th index of list
Input : List = 10,20,30,90,10,10,40,50

QUESTION 8.4:
Description : Add a value 100 at the last index of 10 in the list
Input : List = 10,20,30,90,10,10,40,50

QUESTION 9:
QUESTION 9.1:
Description : Replace the value 300 into 350 in the list
Input : List = 100,200,300,400,500,600,700
QUESTION 9.2:
Description : Replace the value present in 7th index as 90
Input: List = 10,20,30,90,10,10,40,50,10
QUESTION 9.3:
Description : Replace the 10 into 100 in List
Input: List = 10,20,30,90,10,10,40,50,30
Output: List = 100,20,30,90,100,100,40,50,30

QUESTION 10:
QUESTION 10.1:
Description : Create a new ArrayListlists with values and return the common values
Input : List = 10,20,30,90,10,10,40,50
Input : List = 30,40,50,60,80

QUESTION 10.2:
Description : Create a new ArrayListlists with values and return the common values
Input : List = 10,20,30,90,10,10,40,50
Input : List = 10,20,60,50,40,70,80,90

QUESTION 10.3:
Description : Create a new ArrayListlists with values and return the common values
Input : List = 10,20,30,40,50,60,70,80
Input : List = 100,200,300,400,500,600,700,8000

QUESTION 11:
QUESTION 11.1:
Description : Create a new ArrayListlists with values and perform removeAll() function
Input : List = 10,20,30,90,10,10,40,50
Input : List = 30,40,50,60,80

QUESTION 11.2:
Description : Create a new ArrayListlists with values and perform removeAll() function
Input : List = 10,20,30,90,10,10,40,50
Input : List = 10,20,60,50,40,70,80,90

QUESTION 11.3:
Description : Create a new ArrayListlists with values and perform removeAll() function
Input : List = 10,20,30,40,50,60,70,80
Input : List = 100,200,300,400,500,600,700,8000

Day 8 User defined Set,Set:


[Link] List
[Link] vs Vector
[Link] and types

QUESTIONS(Theory)
[Link] the Collections type hierarchy. What are the main interfaces, and what are the
differences between them?
[Link] about user defined list?
[Link] what is Linked List?
[Link] is difference between set and List?
[Link] is the difference between HashSet and TreeSet ?
[Link] between Enumurator,Iterator and List Iterator
[Link] to convert List into Set

QUESTIONS:
QUESTION 1.1:
Description : Create a HashSet for the below values
Input : List = 10,20,30,40,50,60,70,80,90,10,20

QUESTION 1.2:
Description : Create a LinkedHashSet for the below values
Input : List = 10,20,30,40,50,60,70,80,90,10,20

QUESTION 1.3:
Description : Create a TreeSet for the below values
Input : List = 10,20,30,40,50,60,70,80,90,10,20

QUESTION 2:
QUESTION 2.1:
Description : Convert the below list in to set(use addAll()) method
Input : List = 10,20,30,90,10,10,40,50

QUESTION 2.2:
Description : Convert the below list in to set(use addAll()) method
Input : List = 105,205,305,405,505,605,705,805,505,605

QUESTION 2.3:
Description : Convert the below list in to set(use addAll()) method
Input : List = 100,200,300,400,500,600,700,100,300,500

QUESTION 3:
QUESTION 3.1:
Description : Get the each value of set by using enhanced for loop
Input: List = 105,205,305,405,505,605,705,805

QUESTION 3.2:
Description : Create a TreeSet and iterate each value in the set by using enhanced for loop
Input : List = 10,20,30,40,50,60,70,80,90,10,20

QUESTION 3.3:
Description : Create a HashSet and iterate each value in the set by using enhanced for loop
Input : List = 10,20,30,40,50,60,70,80,90,10,20

QUESTION 4:
QUESTION 4.1:
Description : Create a new HashSet with values and return the common values
Input : List = 10,20,30,90,10,10,40,50
Input : List = 30,40,50,60,80
QUESTION 4.2:
Description : Create a new LinkedHashSet with values and return the common values
Input : List = 10,20,30,90,10,10,40,50
Input : List = 10,20,60,50,40,70,80,90

QUESTION 4.3:
Description : Create a new TreeSet with values and return the common values
Input : List = 10,20,30,40,50,60,70,80
Input : List = 100,200,300,400,500,600,700,8000

QUESTION 5:
QUESTION 5.1:
Description : Create a new HashSet with values and perform removeAll() function
Input : List = 10,20,30,90,10,10,40,50
Input : List = 30,40,50,60,80

QUESTION 5.2:
Description : Create a new LinkedHashSet with values and perform removeAll() function
Input : List = 10,20,30,90,10,10,40,50
Input : List = 10,20,60,50,40,70,80,90

QUESTION 5.3:
Description : Create a new TreeSet with values and perform removeAll() function
Input : List = 10,20,30,40,50,60,70,80
Input : List = 100,200,300,400,500,600,700,8000

QUESTION 6:
Description: Create a userdefine Set and insert the 10 employee details
Input : empId,name,phone,address,dob,doj,eMail,gender,Sal
Output: Using scanner class insert 10 employee details

QUESTION 7:
Description: Create a userdefine Set and insert the 10 Student details
Key : stdId,stdName,stdPhone,address,dOB,eMail,gender
Give the related values for key for each Student

DAY 9 Map,User Defined Map:


[Link] and types
[Link] define Map

QUESTIONS(Theory)
[Link] is map?
[Link] is difference between Hash Map and Hash Table?
[Link] is difference between set and Map?
[Link] are the classes implementing List interface?
[Link] all classes implement Set interface ?
[Link] about user defined Map?
[Link] null allows in below maps:
HashMap :k?,v?
LinkedHashMap:k?,v?
TreeMap :k?,v?
HashTable :k?,v?
[Link] to Iterate Map ?
[Link] type entrySet?

QUESTIONS(practical)
QUESTION 1.1:
Description : Create a HashMap with the below key and values
key : 10,20,30,40,50,60,10,50,40
values : java,sql,oops,Sql,oracle,DB,selenium,psql,Hadoop.

QUESTION 1.2:
Description : Create a LinkedHashMap with the below key and values
key : 10,20,30,40,50,60,10,50,40
Values : 10,20,30,40,50,60,10,50,40

QUESTION 1.3:
Description : Create a TreeHashMap with the below key and values
key : !,@,#,$,%,^,&,*,(,
Values : 10,20,30,40,50,60,10,50,40

QUESTION 1.4:
Description : Create a HashTable with the below key and values
Key : vel,Ganesh,Dinesh,Vengat,subash
Values : Selenium,framework,oracle,corejava,jira

QUESTION 2:
QUESTION 2.1:
Description : Create a HashMap with the below key and values and get(print) the key only in
the map.
key : 10,20,30,40,50,60,10,50,40
values : java,sql,oops,Sql,oracle,DB,selenium,psql,Hadoop.

QUESTION 2.2:
Description : Create a LinkedHashMap with the below key and values and get(print) the key
only in the map.
key : 10,20,30,40,50,60,10,50,40
Values : 10,20,30,40,50,60,10,50,40

QUESTION 2.3:
Description : Create a TreeMap with the below key and values and get(print) the key only in
the map.
key : !,@,#,$,%,^,&,*,(,
Values : 10,20,30,40,50,60,10,50,409
QUESTION 2.4:
Description : Create a HashTable with the below key and values and get(print) the key only
in the map.
Key : vel,Ganesh,Dinesh,Vengat,subash
Values : Selenium,framework,oracle,corejava,jira
QUESTION 3:
QUESTION 3.1:
Description : Create a HashMap with the below key and values and get(print) the values only
in the map.
key : 10,20,30,40,50,60,10,50,40
values : java,sql,oops,Sql,oracle,DB,selenium,psql,Hadoop.
QUESTION 3.2:
Description : Create a LinkedHashMap with the below key and values and get(print) the
values only in the map.
key : 10,20,30,40,50,60,10,50,40
Values : 10,20,30,40,50,60,10,50,40

QUESTION 3.3:
Description : Create a TreeHashMap with the below key and values and get(print) the values
only in the map.
key : !,@,#,$,%,^,&,*,(,
Values : 10,20,30,40,50,60,10,50,409

QUESTION 3.4:
Description : Create a HashTable with the below key and values and get(print) the key only
in the map.
Key : vel,Ganesh,Dinesh,Vengat,subash
Values : Selenium,framework,oracle,corejava,jira

QUESTION 4:
QUESTION 4.1:
Description : Create a HashMap with the below key and values and iterate it using enhanced
for loop.
key : 10,20,30,40,50,60,10,50,40
values : java,sql,oops,Sql,oracle,DB,selenium,psql,Hadoop.

QUESTION 4.2:
Description : Create a LinkedHashMap with the below key and values and iterate it using
enhanced for loop.
key : 10,20,30,40,50,60,10,50,40
Values : 10,20,30,40,50,60,10,50,40

QUESTION 4.3:
Description : Create a TreeHashMap with the below key and values and iterate it using
enhanced for loop.
key : !,@,#,$,%,^,&,*,(,
Values : 10,20,30,40,50,60,10,50,409

QUESTION 4.4:
Description : Create a HashTable with the below key and values and iterate it using enhanced
for loop.
Key : vel,Ganesh,Dinesh,Vengat,subash
Values : Selenium,framework,oracle,corejava,jira
QUESTION 5:
QUESTION 5.1:
Description : Create a HashMap with the below key and values and iterate it using enhanced
for loop and get the key and values combination.
key : 10,20,30,40,50,60,10,50,40
values : java,sql,oops,Sql,oracle,DB,selenium,psql,Hadoop.

Sample Output:
10
java
20
sql
30
oops
40
sql
Description : like this you have to itearte the map

QUESTION 5.2:
Description : Create a LinkedHashMap with the below key and values and iterate it using
enhanced for loop and get the key and values combination..
key : 10,20,30,40,50,60,10,50,40
Values : 10,20,30,40,50,60,10,50,40

QUESTION 5.3:
Description : Create a TreeHashMap with the below key and values and iterate it using
enhanced for loop and get the key and values combination.
key : !,@,#,$,%,^,&,*,(,
Values : 10,20,30,40,50,60,10,50,409

QUESTION 5.4:
Description : Create a HashTable with the below key and values and iterate it using enhanced
for loop and get the key and values combination.
Key : vel,Ganesh,Dinesh,Vengat,subash
Values : Selenium,framework,oracle,corejava,jira

QUESTION 6:
Description: Create a userdefine Map and insert the 10 employee details
Key : empId,name,phone,address,dob,doj,eMail,gender,Sal
Give the related values for key for each employee

QUESTION 7:
Description: Create a userdefine Map and insert the 10 Student details
Key : stdId,stdName,stdPhone,address,dOB,eMail,gender
Give the related values for key for each Student
DAY 10 Exception:
[Link]
[Link] and throws
[Link] define exception

QUESTIONS(Theory)
[Link] is Exception?
[Link] about types of Expection?
[Link] between checked expection and unchecked expection?
[Link] are the differences between exception and error?
[Link] is the super class for Exception and Error?
[Link] are defined in which java package
[Link] is throw keyword in java?
[Link] we have try block without catch block?
[Link] we write multiple catch blocks under single try block?
[Link] to write user defined exception or custom exception in java?
[Link] are the different ways to print exception message on console?
[Link] are the differences between final finally and finalize in java?
[Link] we write return statement in try and catch blocks?
[Link] we write return statement in finally block?
[Link] are the differences between throw and throws?
[Link] are the Exception Handling Keywords in Java?
[Link] Java Exception Hierarchy?
[Link] to create custom Exception?

QUESTIONS(Programs)
QUESTION 1:
Description : Find the output for the program:
public class Test
{
public static void main(String[] args)
{
try
{
[Link]("1")
int sum = 9 / 0;
[Link]("2");
}
catch(ArithmeticException e)
{
[Link]("3");
}
catch(Exception e)
{
[Link]("4");
}
finally
{
[Link]("5");
}}}
QUESTION 2:
Description : Find the output for the program:
public class Test
{
private void m1()
{
m2();
[Link]("1");
}
private void m2()
{
m3();
[Link]("2");
}
private void m3()
{
[Link]("3");
try
{
int sum = 4/0;
[Link]("4");
}
catch(ArithmeticException e)
{
[Link]("5");
}
[Link]("7");
}
public static void main(String[] args)
{
Test obj = new Test();
obj.m1();
}
}}

QUESTION 3:
Description : Find the output for the program:
public class Test
{
public static void main(String[] args)
{
try
{
[Link]("1");
int data = 5 / 0;
}
catch(ArithmeticException e)
{
[Link]("2");
[Link](0);
}
finally
{
[Link]("3");
}
[Link]("4");

QUESTION 4:
Description : Find the output for the program:
public class Test
{
public static void main(String[] args)
{
try
{
[Link]("1");
int data = 5 / 0;
}
catch(ArithmeticException e)
{
Throwable obj = new Throwable("Sample");
try
{
throw obj;
}
catch (Throwable e1)
{
[Link]("8");
}
}
finally
{
[Link]("3");
}
[Link]("4");
}}

QUESTION 5:
Description : Find the output for the program:
import [Link];
import [Link];
public class Test
{
public static void main(String[] args)
{
try
{
[Link]("1");
int value = 10 / 0;
throw new IOException();
}
catch(EOFException e)
{
[Link]("2");
}
catch(ArithmeticException e)
{
[Link]("3");
}
catch(NullPointerException e)
{
[Link]("4");
}
catch(IOException e)
{
[Link]("5");
}
catch(Exception e)
{
[Link]("6");
}}}

DAY 11 JDBC connection:


[Link] Connection
[Link] Introduction

QUESTIONS(Theory)
[Link] is JDBC?
[Link] is JDBC Driver?
[Link] are the steps to connect to the database in java?
[Link] are the JDBC statements?
[Link] is the difference between Statement and PreparedStatement interface?
[Link] is schema?
[Link] is primary key?
[Link] is constraints?

QUESTIONS(Program)
Task 1:
Download Sql work bench and do all setup like creating table,assign primary key and
retrieve all the values from Demoqa register table(manually).
Input :FirstName,LastName,MaritalStatus(Single,Married,Divorced),
Hobby(Dance,Reading,Cricket),Country,DateOfBirth,PhoneNumber,
Username,E-mail,AboutYourself,Password,ConfirmPassword
Output:
Table Created.
Inserted value in table
Deleted value in table
Modified value in table
Task 2:
Download Sql work bench and do all setup like creating table,assign primary key and
retrieve all the values from employee table.
Input :EmpId(PrimaryKey),EmpName,EmpSalary,EmpAddress
Output:Print all the values from the table

Sample Output:
--------------
+------+----------+-----------+------------+
|EmpId | EmpName | EmpSalary | EmpAddress |
+------+----------+-----------+------------+
| 101 | Arun | 2000 | Chennai |
| 102 | Siva | 3000 | Madurai |
| 103 | Varun | 2000 | Selam |
| 104 | Tharun | 1000 | Erode |
+------+----------+-----------+------------+

DAY 12 File Operation:

QUESTIONS(Theory)
[Link] is mean by File? In which package it is available? [Link] are the methods available
in File ?
[Link] creating a file if you not mention the format then under which format it will save the
file?
[Link] are the difference between append and updating the file?
[Link] to compare paths of two files?
[Link] to create a new file?
[Link] to get last modification date of a file?
[Link] to create a file in a specified directory?
[Link] to check a file exist or not?
[Link] to make a file read-only?
[Link] to renaming a file ?
[Link] to get a file's size in bytes?
[Link] to change the last modification time of a file ?
[Link] to create a temporary file?
[Link] to append a string in an existing file?
[Link] to copy one file into another file?
[Link] to delete a file?
[Link] to read a file?
[Link] to write to a file?
[Link] to create directories recursively?
[Link] to delete a directory?
[Link] to get the fact that a directory is empty or not?
[Link] to get a directory is hidden or not?
[Link] to print the directory hierarchy?
[Link] to print the last modification time of a directory?
[Link] to get the parent directory of a file?
[Link] to search all files inside a directory?
[Link] to get the size of a directory?
[Link] to traverse a directory?
[Link] to find current working directory?
[Link] to display root directories in the system?
[Link] to search for a file in a directory?
[Link] to display all the files in a directory?
[Link] to display all the directories in a directory?

QUESTIONS(Practical)

QUESTION 1
NOTE: Create a new file
write the file with some 10 lines of text.

QUESTION 2
NOTE: Retrieve the text from the file
Check "java" word contains or not?

QUESTION 3
NOTE: Find the row count from the file.

QUESTION 4
NOTE: Print the last 5 lines from the file.

QUESTION 5
NOTE: Print the odd lines from the file.

QUESTION 6
NOTE: Count the number of duplicate words available in the file.

QUESTION 7
NOTE: Check directory D:\Java is available or not.

QUESTION 8
NOTE: Check directory D:\Java is available or not.
If not create new directory.

QUESTION 9
NOTE: Create sub directory D:\Java\Selenium\Material.

QUESTION 10
OTE: Print all the available files from an existing folder.

You might also like