Git Product home page Git Product logo

wipro-training-abstraction-packages-exception-handling---assignments-for-packages's Introduction

Wipro TalentNext PBL

Topics Covered

Hands-on Assignments for Packages

No. Hands-on Assignment Topics Covered Status

1

Create a package called test package; Define a class called foundation inside the test package; Inside the class, you need to define 4 integer variables; Var1 as private; Var2 as default; Var3 as protected; Var4 as public; Import this class and packages in another class. Try to access all 4 variables of the foundation class and see what variables are accessible and what are not accessible.

Packages Access control Using package 	

2

Create a class called compartment which represents the ship compartments for watertight subdivision its height, width and breadth. Take care it should not conflict with the compartment class you have created in Abstract class exercise 2. To avoid conflict create this class in a new package called com.wipro.automobile.ship

Packages User defined packages 	

3

Create a package called com.automobile. Define an abstract class called Vehicle. Vehicle class has the following abstract methods: public String getModelName() public String getRegistrationNumber() public String getOwnerName()

Create TwoWheeler subpackage under Automobile package Hero class extends Automobile.vehicle class public int getSpeed() – Returns the current speed of the vehicle. public void radio() – provides facility to control the radio device Honda class extends com.automobile.vehicle class public int getSpeed() – Returns the current speed of the vehicle. public void cdplayer() – provides facility to control the cd player device which is available in the car. Create a test class to test the methods available in all these child class.

Packages User defined packages 	

4

Add the following ideas to the previous hands on: Create FourWheeler subpackage under Automobile package Logan class extends com.automobile.vehicle class public int speed() – Returns the current speed of the vehicle. public int gps() – provides facility to control the gps device Ford class extends com.automobile.vehicle class public int speed() – Returns the current speed of the vehicle. public int tempControl() – provides facility to control the air conditioning device which is available in the car

Packages User defined packages 	

wipro-training-abstraction-packages-exception-handling---assignments-for-packages's People

Contributors

cyberster avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.