Practice Set: Unit 4
1. What are the uses of super keyword in Java? Explain with a suitable example.
2. What are the various uses of final keyword in java? An abstract method can not be declared final. Why?
3. Differentiate between Abstract class and Interface. What do you mean by Functional interface and Lambda Expression?
4. Define Anonymous class. Why we use anonymous class in Java?
5. Differentiate between static nested class and inner class in java.
6. Write a program to define a class named Demo which contains a local class named MyLocal inside its constructor. Define a method sayHello (String XXX) to display Hello XXX (e.g Hello Ravi if name is Ravi).
Define a class named TestLocal which reads the name from the user and then invoke the sayHello method of MyLocal class.
7. Complete the following program as per comments.
abstract class A
{
abstract void x();
abstract void y();
}
class UseAbstract
{
/*Use anonymous class to define and call methods of abstract class A*/
}
8. Create a functional interface Predicate with an abstract method test with following signature:
boolean test(String t);
Write a test program to check a string contains character 'c' or not by using above test method with the help of lambda expression.
9. Write a program to define an interface Testing which contains an abstract method
boolean checkString(String str)
Create a class Input which must contain a method String getInput(Testing obj) which prompts the user to enter a String and the String must be checked using the checkString such that it returns TRUE only when the String contains all the vowels. If input is correct then display “String Accepted” otherwise ask to re-enter the String.
10. Write a program to create a class Employee with appropriate fields for employee name, employee id and Vehicle.
Vehicle is a nested class with attributes vehicle number and owner name. An employee may or may not have a vehicle.
Create at least 3 employee objects using appropriate constructor and store the employee objects in a collection.
Implement a method getVehicleDetails(String Vehicle_number) to display the name and id of the employee who own that vehicle.
thanks for sharing this info java training
ReplyDeletehttps://youtu.be/WhjblBJQd0E
ReplyDeletehttps://youtu.be/WhjblBJQd0E
ReplyDeleteHi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging.
ReplyDeleteangularjs Training in chennai
angularjs Training in chennai
angularjs-Training in tambaram
angularjs-Training in sholinganallur
nice topic
ReplyDeletehttp://www.greenstechnologys.com/java-training-course-content.html
This comment has been removed by the author.
ReplyDeleteGreat post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
ReplyDeleteData Science training in Chennai | Data science training in bangalore
Data science training in pune | Data science online training
Data Science Interview questions and answers
ReplyDeleteThank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
java developers in hyderabad
java developers in gachibowli
java developing companies in hyderabad
java developing companies in gachibowli
java developing companies ameerpet
java development company in hyderabad
Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
ReplyDeletejava developers in hyderabad
Now this is very easy to withdraw bitcoin from blockchain wallet to paypal account just in seconds. This website is providing you many features and facilities. This is best chance to register for free and get surprises from our company on this new year.
ReplyDeleteNow this is very easy to withdraw bitcoin from blockchain wallet to paypal account just in seconds. This website is providing you many features and facilities. This is best chance to register for free and get surprises from our company on this new year.
ReplyDeleteHello, I read your blog occasionally, and I own a similar one, and I was just wondering if you get a lot of spam remarks? If so how do you stop it, any plugin or anything you can advise? I get so much lately it’s driving me insane, so any assistance is very much appreciated.
ReplyDeleteAndroid Training in Chennai
Selenium Training in Chennai
Devops Training in Chennai
Some us know all relating to the compelling medium you present powerful steps on this blog and therefore strongly encourage contribution from other ones on this subject while our own child is truly discovering a great deal. Have fun with the remaining portion of the year.
ReplyDeleteMicrosoft Azure online training
Selenium online training
Java online training
Java Script online training
Share Point online training
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
ReplyDeleteRegards,
Dot Net Training Institute in Chennai | Dot Net coaching Institute in Chennai | Dot Net Training in Chennai
Selenium Training in Chennai | Selenium Testing Training in Chennai | Selenium Training Institute in Chennai
Manual Testing Training in Chennai | Software Testing Training Institute in Chennai | Testing Courses in Chennai
Java Training Institute in Chennai | Core Java Training in Chennai | Java Course and Certification
PHP Course in Chennai | PHP Training in Chennai | PHP Training Institute in Chennai
Well written post with worthy information. It will definitely be helpful for all. Do post more like this.
ReplyDeleteBlue Prism Training in Chennai
Blue Prism Training in Anna Nagar
RPA Training in Chennai
RPA course in Chennai
UiPath Training in Chennai
RPA Training in Velachery
UiPath Training in Chennai
Blue Prism Training in Chennai
Visit : https://mlait.tech for more updates on different programming languages.
ReplyDeletethanks for this mock test it is very useful
ReplyDeletejava training in velachery
Thanks for sharing this informative blog java training in chennai
ReplyDeleteWebsite designing Company Shamli
ReplyDeleteWebsite Designing Company Varanasi
Web Designing Gorakhpur
Website designing Company Ghazipur
Website designing Company Dehradun
Website designing Company Shahjahanpur
Website designing Company Lucknow
usa
ReplyDeleteNice Post thanks for the information, good information & very helpful for others
ReplyDeleteইলেকট্রনিক্স পন্য ক্রয় বিক্রয় করুন
click here for more info.
ReplyDelete....................................................................
click here for more info.
ReplyDeleteclick here for more info.
ReplyDelete
ReplyDeleteclick here for more info.
ReplyDeleteclick here for more info.
I should assert barely that its astounding! The blog is informational also always fabricate amazing entitys. live crypto ticker
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI have read your article, it is very informative and helpful for me. I admire valuable information you offer this articles. Thanks for posting it. Flutter App Development Services
ReplyDeleteThis is the first time I am visiting your website. I would like to tell you that I am genuinely engaged by reading your blogs. Keep up the good work! React Native App Development Services
ReplyDeleteWonderful blog & good post.Its really helpful for me, awaiting for more new post. Keep Blogging ! Flutter App Development Services
ReplyDeleteHey thanks for this wonderful information simply explanation is best keep
ReplyDeleteposting im waiting for more post !!!
SEO SERVICE SPECIALIST!
This is Great Article. You are post informatics blog so keep posting.
ReplyDeleteTop SEO Service company in Meerut
website designing company in Meerut
Top 10 CSBE Schools in Meerut
Desawer Satta Number
Website Design Company Meerut
Satta King Number
Meerut News Update
Turn on Bluetooth on a Chromebook
Home Services App in India
Nice Information and keep posting this type of Information.You can also visit us in need of any assistance with Ecucational information.Big Data Course
ReplyDeleteAppreciate you sharing, great article.Much thanks again. Really Cool.. net online training
ReplyDeletedot net online training hydarabad
They're produced by the very best degree developers who will be distinguished for your polo dress creation. You'll find Ron Lauren inside an exclusive array which includes particular classes for men, women.
ReplyDeletebusiness analytics training in hyderabad
BetMGM agrees to revamp sports betting - KTNV
ReplyDeleteBetMGM has agreed 군포 출장안마 to rebrand its online sportsbook, with the move 제천 출장마사지 being 군산 출장마사지 made to 의왕 출장샵 rebrand its 창원 출장샵 sportsbook.
Nice Post
ReplyDeleteYou are providing good information and Keep posting
Top handicraft exporters in india
Best interior designers in Noida
Cheap and best interior designers in Greater Noida