Assignment – 6

GOAL: Understanding Multilevel Inheritance, Abstraction Create an abstract class called HeadOffice. Have below normal methods in it. 2.1. public void check_accounts(int amount) – Have a print statement inside here 2.2. public int pay_tax(int amount) – return this.amount from here Have an abstract method as below. 3.1. public abstract void receive_Customers() Create another abstract class calledContinue reading “Assignment – 6”

Scenario #5:

Expected Understanding: Interface, access modifiers, Method Overriding 1) Create a package called tamilnadu.chennai2) Create an interface ‘TrafficRules’ under this package3) Make sure this interface is public interface– Add variable String trafficCommisssioner = “Kavin”;– Add below methods– void goByDieselVehicle();– void goByBicycle(); 4) Create class called ‘CommonManInChennai’ with main method in the same package tamilnadu.chennai– Implement interfaceContinue reading “Scenario #5:”

Scenario #4:

Expected Understanding: Abstraction, Inheritance, Dynamic Binding, Polymorphism (Overriding), Constructor Overloading 1) Create an abstract class called ‘India’– Have below abstract methods– void speakLanguage()– void eat()– void dress()– Have static variable String capital = “New Delhi”– Have below Constructorpublic India(String primeMinister){System.out.println(“our Prime Minister is” + primeMinister);} 2) Create an abstract class called ‘SouthIndia’– Make this classContinue reading “Scenario #4:”

Scenario #3:

Expected Understanding: Abstraction, Inheritance, return keyword, Method Arguments, Constructor 1) Create an abstract class named ‘SmartPhone’– Add the below abstract methods– int call(int seconds)– void sendMessage()– void receiveCall()– Add non abstract method void browse()– print ‘SmartPhone browsing’ inside browse() method definition– Have constructor as below.public SmartPhone(){System.out.println(“Smartphone under development”);} 2) Create class called ‘FactoryDemo’ as abstractContinue reading “Scenario #3:”

Scenario #2

Expected Understanding: Interface, Class, static variables, dynamic binding 1) Create an interface called ‘Actor’– Have variables boolean makeUpRequired– Assign ‘true’ value for ‘makeUpRequired’– Have variable String address.– Assign value as “Chennai” to address.– Have void methods act(), dance(), sing() 2) Create class named as ActorSivakumar with main method– implement interface ‘Actor’ to this class.– GiveContinue reading “Scenario #2”

Scenario #1:

Expected Understanding: Access Modifiers, Single Inheritance, getter methods, Constructor Overloading 1) Create a Class named “Trainer”.– Have default instance variables String dept, institute– Have private instance variable int salary– Assign 10000 as value for salary.– Create getter method for salary.– Assign values – “Java”, “Payilagam” to them– Have instance method training() with void as returnContinue reading “Scenario #1:”

Sql Assignment

1.Create a student table with FirstName, LastName,Dob,Gender,TotalMarks,City and State as columns. 2.Insert 20 hetrogenious records in the student table. select * from Student 3.Select the student list who are all living in city chennai. 4.Select the student list according to the TotalMarks in ascending order. 5.Select the student list according to the FirstName in desceningContinue reading “Sql Assignment”

Use of super and final keyword in java

super keyword: The super keyword refers to superclass (parent) objects. It is used to call superclass methods, and to access the superclass constructor. The most common use of the super keyword is to eliminate the confusion between superclasses and subclasses that have methods with the same name. Usage of Java super Keyword super can beContinue reading “Use of super and final keyword in java”

Create your own website, free on WordPress.com.Create your own website.
Start free