Inheritance qustion

HI,
when its recommended to use Inheritance and when not?
Regards

>
Cosmo  Kramer wrote:
> HI,
>
> when its recommended to use Inheritance and when not?
>
> Regards
Then when you stop asking interview questions here and start using the search...
Please search first, and ask specific questions later!
Thread closed...!

Similar Messages

  • Violating Inheritance and OOD?

    I have a question about JAVA and OOD
    Here's the question (summary):
    If I have a abstract base class that implements a method (example: baseMethod())
    that needs to call another method that is declared abstract (example: extendedMethod()),
    and this method is implemented in a class that extends the base class;
    if I have an object of an unknown type, but I do know it is a child class
    of the base class, and so I cast it to the base class and call the method
    baseMethod() which calls extendedMethod(), this will reference extendedMethod of the
    CORRECT child class, that is still unknown (other then we know it is a child of the base
    class that we casted it to). HOW and WHY does this work? Also, does it violate any rules
    of OOD? Please email [email protected] with the answer and post it here if possible.
    The Qustion is Best explained with some code:
    ==============================================================
    //Abstract Base Class that Child Classes Inherit From.
    //Implements a public method called baseMethod that
    //calls extendedMethod, however extendedMethod is only declared in
    //this class as an abstract method so, child Classes that extend BaseClass
    //MUST implement extendedMethod or of coruse declare it abstract.
    //However, for baseMethod to execute it must call extendedMethod.
    abstract public class BaseClass
         public void baseMethod()
              String temp="Hello World!";
              extendedMethod(temp);
         abstract public void extendedMethod(String s);
    ==============================================================
    //This is a child class that extends BaseClass.
    //It implements extendedMethod in a certain way.
    public class ChildClass1 extends BaseClass
         public ChildClass1(){}
         public void extendedMethod(String s)
              System.out.println("Child 1: "+s);
    ==============================================================
    //This is another child class that extends BaseClass.
    //It implements extendedMethod in a certain way that is
    //a little different from ChildClass1.
    public class ChildClass2 extends BaseClass
         public ChildClass2(){}
         public void extendedMethod(String s)
              System.out.println("Child 2: "+s);
    ==============================================================
    //This is a test driver class that has a ChildClass1 and a ChildClass2.
    //It has a method called getChildClass which returns type object, since
    //it could return many different classes and you really don't know
    //which one gets returned. You have to call extendedMethod from the
    //object that is returned from getChildClass, but you only can
    //CAST it to the BaseClass since you don't know which Child class type
    //is being returned to you.
    //QUESTION: After you get the object returned by getChildClass, and you have
    //casted it back to BaseClass, you call extendedMethod, which in type BaseClass
    //is an abstract method. HOW and WHY does this work? Also, does this violate any
    //rules of OOD? Please email [email protected] with the answer and post it here if possible.
    public class Test
         private ChildClass1 childClass1;
         private ChildClass2 childClass2;
         public Test()
              childClass1=new ChildClass1();
              childClass2=new ChildClass2();
         public Object getChildClass(int which)
              if (which==1)
                   return childClass1;
              else if (which==2)
                   return childClass2;
              else
                   return null;
         public static void main(String[] args)
              Test test=new Test();
              BaseClass bc;
              bc=(BaseClass)test.getChildClass(1);
              if (bc!=null)
                   bc.baseMethod();
              bc=(BaseClass)test.getChildClass(2);
              if (bc!=null)
                   bc.baseMethod();
    ==============================================================

    Now obj can only call Method1 ONLY because it is down
    at the first level!wrong. It can call any method declared in A even abstract ones. If it couldn't there would be no reason for abstract methods.
    In terms of memory allocation
    space, shouldn't it be that once I cast to a "smaller"
    object, the rest of the "stuff" such as Method2 and
    Method 3 from the "bigger" objects are not in the
    memory address space for obj? I like the answer
    because the compiler is made that way! That's what I'mThe actual memory taken up by the instance does not change. All you have done is modified the reference type.
    looking for, just I want to know how it does that! I
    think the compiler just changes the class name but
    does not modify the object in memory! I think this is
    the easiest way to mange this type of problem in terms
    of JVM design. But isn't this saying in terms of OOD
    that: My Child inherits certain abilities from me, but
    I can also use the internal workings of my child. I
    thought Inheritance was uni-directional, please
    correct me if I'm wrong, I'm very interested in the
    answer. Sorry, about the incomplete thoughts in the
    previous mails, but at least you understood what I
    meant, hey what can I say, I'm laconic (using few
    words! :) ).Maybe this will help.
    public class Example {
         private static C see = new C();
         static void main(String args[]) {
              A a = getA();
              B b = getB();
              C c = getC();
              System.out.println("a.method2 returns: " + a.method2());
              System.out.println("b.method3 returnds: " + b.method3());
              System.out.println("a and b are the same object: " + (a == b));
              System.out.println("a and c are the same object: " + (a == c));
              System.out.println("b and c are the same object: " + (b == c));
         public static A getA() {
              return (A) see;
         public static B getB() {
              return (B) see;
         public static C getC() {
              return see;
    abstract class A {
         public String method1() {
              return "A.method1";
         public abstract String method2();
    abstract class B extends A{
         public String method2() {
              return "B.method2";
         public abstract String method3();
    class C extends B {
         public String method3() {
              return "C.method3";
    }

  • Logical Database PNPCE and inherited Sub Area

    Hi,
    I have asked this in the HR forum but no response......
    I have a report using Logical Database PNPCE to find some values from a couple of info types. When I select a unit (from the 'OrgStructure' button at the top of the screen), say 111, and all its sub-units with no selections in the selection screen, I get one person displayed. This is correct and this person is in a sub-unit 3 levels down (unit 333).
    I then added a selection to only display people in units with Personnel SubArea 'OTEC'. Now I get no results output. When I look in PPOME, I can see that unit 333 has Personnel SubArea 'OTEC' but it is inherited from '111'.
    In PP01, unit 111 has an Account Assignment entry (Info Type 1008) but 333 does not.
    Does anyone know how to report on this?
    Is there a flag somewhere that tells the LDB to check for inherited units?
    If not, any ideas if there is a function out there to find the superior unit for these sub-units?
    Thanks.

    Thanks,
    I am aware of that FM but how do I find the parent unit in a clever fashion?
    The structure could have multiple levels e.g.
    Unit 1 - Unit 2a - Unit3a......
           - Unit 2b
           - Unit 2c
    Unit 1 is the parent and all the below units inherit from it.
    The LDB is looping through an internal table with a list of the units. It finds Unit 1 but not the rest.
    So, when the LDB is looking for Unit 3a, how does it know that Unit 1 is the parent?
    If I use that FM, I think I would have to look for all units above it and see if there is an Info Type 1008 exists. Seems like a lot of processing for something that should be simple?
    Kroc.

  • Qustion in abap objects

    hallow
    i wont to now what is the difference betwen  public & private please give me
    example of benefit of both.and when its  recommended to use any of them
    Regards

    Public Class :
    Data declared in public section can be accessed by the class itself, by its subclasses as well as by other users outside the class.
    Private Class :
    Data declared in the private section can be accessed by the class only, but not by its subclasses and by external users outside the class.
    REPORT YSUBDEL LINE-SIZE 120.
    CLASS parentclass DEFINITION .
    PUBLIC SECTION.
    DATA : commondata(30) type c value 'Accessible to all'.
    METHODS : SHOWVAL.
    PROTECTED SECTION.
    DATA : protectdata(40) type c value 'Protected data'.
    private section.
    data : privatedata(30) type c value 'Private data'.
    ENDCLASS.
    CLASS parentclass IMPLEMENTATION.
    METHOD : SHOWVAL.
    write:/5 'All data from parentclass shown:-'.
    write:/ sy-uline.
    WRITE:/5 COMMONDATA,
    /5 PROTECTDATA,
    /5 PRIVATEDATA.
    endmethod.
    endclass.
    CLASS childclass DEFINITION INHERITING FROM parentclass.
    PUBLIC SECTION .
    METHODS : subval.
    ENDCLASS.
    CLASS childclass IMPLEMENTATION.
    method : subval.
    skip 1.
    write:/5 'Data of parent shown from child-'.
    write:/5 sy-uline.
    WRITE:/5 COMMONDATA,
    /5 PROTECTDATA.
    Commondata = 'Public data changed in subclass'.
    Protectdata = 'Protected data changed in subclass'.
    write:/5 sy-uline.
    WRITE:/5 COMMONDATA,
    /5 PROTECTDATA.
    endmethod.
    endclass.
    START-OF-SELECTION.
    DATA : parent type ref to parentclass ,
    child type ref to childclass .
    create object : parent ,
    child .
    call method : parent->showval ,
    child->subval.
    skip 2.
    parent->commondata = ‘User changing public data’.
    write:/5 parent->commondata.
    Thanks
    Seshu

  • Inherited UserControl can not find XAML defined elements

    Hello,
    As the title suggests, I have a UserControl, called "DashboardControl", that is used across all of our games in a project that is shared among the games. In each of our projects we have a uniquely defined Dashboard.XAMLs that is specific to that
    project.
    This works fine for all of our projects but now I need to add some additional functionality unique to one project so I created a new UserControl called "GameSpecificDashboardControl" that inherits from the Dashboard. I changed the XAML so that
    it references the GameSpecificDashboardControl as it's view model. Unfortunately, whenever I call a Storyboard from the GameSpecificDashboardControl, I get the following error:
    "WinDisplay" name can not be found in name scope of GameSpecificDashboardControl
    In short, my GameSpecific is calling a Storyboard (which can be found) but the storyboard is trying to change an element that can not be found. What doesnt make sense is that not only is WinDisplay clearly defined in the XAML, but Snoop also shows the WinDisplay
    exists, as well as looping through the visual tree shows that WinDisplay exists.
    I'd appreciate any help anyone can give on this issue, I'm lost on ideas at this point.
    NOTE: If I move the 'sbBigWinIntro' & 'sbBigWinEnd' code to the 'PART_SBWinTickerIntro' & 'PART_SBWinTickerEnd' storyboards, I get no error. Unfortunately I need these animations to execute under certain conditions so keeping them
    in the PART_ storyboards doesnt work for me.
    NOTE2: The PART_ storyboards mentioned above are called in the base DashboardControl which I can not include in this post.
    Below are the XAML and code-behind files:
    XAML
    <ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:views="clr-namespace:Frozen7ViewModule.Views"
    xmlns:vwc="clr-namespace:ViewCommon;assembly=ViewCommon"
    xmlns:vwcd="clr-namespace:ViewCommon.Dashboard;assembly=ViewCommon"
    xmlns:vwcc="clr-namespace:ViewCommon.Converters;assembly=ViewCommon"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
    xmlns:CustomControlLib="clr-namespace:CustomControlLib;assembly=CustomControlLib"
    mc:Ignorable="d">
    <Style TargetType="{x:Type views:GameSpecificDashboardControl}">
    <Setter Property="BoundCustomerBalance" Value="{Binding CustomerBalance}"/>
    <Setter Property="BoundWinAmount" Value="{Binding WinAmount}"/>
    <Setter Property="BoundBetAmount" Value="{Binding BetAmount}"/>
    <Setter Property="RaiseSoundCommand" Value="{Binding GVMSound.GameSoundCommand}"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate>
    <ControlTemplate.Resources>
    <Storyboard x:Key="sbBigWinIntro" FillBehavior="HoldEnd" BeginTime="0:0:0.0">
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="200"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="-300"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="3"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="3"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="WinBox_SolidBack">
    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="sbBigWinEnd" FillBehavior="HoldEnd">
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="633"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="348"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="WinDisplay">
    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="WinBox_SolidBack">
    <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
    </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="PART_SBWinTickerIntro" FillBehavior="HoldEnd" BeginTime="0:0:0.0">
    </Storyboard>
    <Storyboard x:Key="PART_SBWinTickerEnd" FillBehavior="HoldEnd">
    </Storyboard>
    <Storyboard x:Key="PART_SBInfoTextIntro" FillBehavior="Stop">
    </Storyboard>
    </ControlTemplate.Resources>
    <Canvas x:Name="GameStateTarget" Width="1680" Height="200">
    <Canvas.Resources>
    <Style TargetType="{x:Type TextBlock}">
    <Setter Property="FontFamily" Value="/Frozen7ViewModule;component/Fonts/#Celtic Gaelige"/>
    <Setter Property="HorizontalAlignment" Value="Center"/>
    <Setter Property="Foreground" Value="White"/>
    <Setter Property="FontSize" Value="60"/>
    </Style>
    <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </Canvas.Resources>
    <VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="ShowValueStateGroup">
    <VisualState x:Name="ShowMoneyState">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="WinAmountCredits">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="CustomerBalanceCredits">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="BetAmountCredits">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TBInfoText">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="WinAmountMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="CustomerBalanceMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="BetAmountMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TBInfoTextMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="ShowCreditsState">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="WinAmountCredits">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="CustomerBalanceCredits">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="BetAmountCredits">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TBInfoText">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="WinAmountMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="CustomerBalanceMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="BetAmountMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TBInfoTextMoney">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    </VisualStateGroup>
    <VisualStateGroup x:Name="VolumeStateGroup">
    <VisualState x:Name="VolumeMaxState">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ContentControl.Content)" Storyboard.TargetName="VolumePercentTarget">
    <DiscreteObjectKeyFrame KeyTime="0" Value="100"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="VolumeMediumState">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ContentControl.Content)" Storyboard.TargetName="VolumePercentTarget">
    <DiscreteObjectKeyFrame KeyTime="0" Value="66"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="VolMed">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="VolMax">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="VolumeLowState">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ContentControl.Content)" Storyboard.TargetName="VolumePercentTarget">
    <DiscreteObjectKeyFrame KeyTime="0" Value="33"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="VolLow">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="VolMax">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    </VisualStateGroup>
    <VisualStateGroup x:Name="GameDenominationStateGroup">
    <VisualState x:Name="State_gfs7h25_cfg">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="OneDollarGameIcon">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FiveDollarGameIcon">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="State_gfs7h100_cfg">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TwentyFiveCentGameIcon">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FiveDollarGameIcon">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="State_gfs7h500_cfg">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="TwentyFiveCentGameIcon">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="OneDollarGameIcon">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    </VisualStateGroup>
    <!--View Race States-->
    <VisualStateGroup x:Name="RaceVideoOptionAvailableStateGroup">
    <VisualState x:Name="RaceVideoOptionAvailableFalse">
    <Storyboard>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ViewRaceCanvas">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MakePicksCanvas">
    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
    </ObjectAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="InfoCanvas">
    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="1480"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="InfoCanvas">
    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="417"/>
    </DoubleAnimationUsingKeyFrames>
    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Top)" Storyboard.TargetName="VolCanvas">
    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="415"/>
    </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="RaceViewOptionAvailableTrue">
    <Storyboard>
    </Storyboard>
    </VisualState>
    </VisualStateGroup>
    <VisualStateGroup x:Name="RaceVideoSelectedStateGroup">
    <VisualState x:Name="RaceVideoSelectedFalse">
    <Storyboard>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="RaceVideoSelectedTrue">
    <Storyboard>
    </Storyboard>
    </VisualState>
    </VisualStateGroup>
    <VisualStateGroup x:Name="BalanceIsPartialCreditStateGroup">
    <VisualState x:Name="BalanceIsPartialCreditFalse">
    <Storyboard>
    </Storyboard>
    </VisualState>
    <VisualState x:Name="BalanceIsPartialCreditTrue">
    <Storyboard>
    </Storyboard>
    </VisualState>
    </VisualStateGroup>
    <VisualStateGroup x:Name="ValidationStates">
    <VisualState x:Name="Valid"/>
    <VisualState x:Name="InvalidFocused"/>
    <VisualState x:Name="InvalidUnfocused"/>
    </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>
    <i:Interaction.Behaviors>
    <vwc:VisualStateSyncStateToBoundValue BoundStateValue="{Binding RaceVideoOptionAvailable}" StateNamePrefix="RaceVideoOptionAvailable" VerifyTemplateChildName="ViewRaceCanvas"/>
    <vwc:VisualStateSyncStateToBoundValue BoundStateValue="{Binding RaceVideoSelected}" StateNamePrefix="RaceVideoSelected" VerifyTemplateChildName="ViewRaceOn"/>
    <vwc:VisualStateSyncStateToBoundValue BoundStateValue="{Binding BalanceIsPartialCredit}" StateNamePrefix="BalanceIsPartialCredit" VerifyTemplateChildName="CustomerBalanceCredits"/>
    </i:Interaction.Behaviors>
    <!--
    VolumeState storyboards update VolumePercentTarget,
    causing PropertyChangedTrigger to invoke SetVolumePercent() command on view model
    -->
    <!--
    VolumeState storyboards update VolumePercentTarget,
    causing PropertyChangedTrigger to invoke SetVolumePercent() command on view model
    -->
    <ContentControl x:Name="VolumePercentTarget" Content="0" Visibility="Hidden" >
    <i:Interaction.Triggers>
    <ei:PropertyChangedTrigger Binding="{Binding Content, ElementName=VolumePercentTarget}">
    <i:InvokeCommandAction Command="{Binding SetVolumePercent, Mode=OneTime}" CommandParameter="{Binding Content, ElementName=VolumePercentTarget}" />
    </ei:PropertyChangedTrigger>
    </i:Interaction.Triggers>
    </ContentControl>
    <Image x:Name="TwentyFiveCentGameIcon" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Denom_25.png" Canvas.Top="372" />
    <Image x:Name="OneDollarGameIcon" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Denom_100.png" Canvas.Top="372" />
    <Image x:Name="FiveDollarGameIcon" RenderTransformOrigin="0.5,0.5" Canvas.Left="-130" Canvas.Top="372"
    Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Denom_500.png" >
    <Image.RenderTransform>
    <TransformGroup>
    <ScaleTransform ScaleX="0.7" ScaleY="0.9" />
    </TransformGroup>
    </Image.RenderTransform>
    </Image>
    <Canvas x:Name="ViewRaceCanvas" Canvas.Left="1380" Canvas.Top="417" >
    <Image x:Name="ViewRaceOff" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/ViewNextRace.png" />
    <Image x:Name="ViewRaceOn" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/ViewNextRace.png" />
    <Rectangle x:Name="HitBox_ViewRace" Width="{Binding ActualWidth, ElementName=ViewRaceOff}" Height="{Binding ActualHeight, ElementName=ViewRaceOff}" Fill="Green" Opacity="0" >
    <Rectangle.Resources>
    <sys:Boolean x:Key="BoolTrue">True</sys:Boolean>
    </Rectangle.Resources>
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="MouseLeftButtonDown">
    <i:InvokeCommandAction Command="{Binding SetRaceVideoSelectedCommand, Mode=OneTime}" CommandParameter="{StaticResource BoolTrue}"/>
    </i:EventTrigger>
    </i:Interaction.Triggers>
    </Rectangle>
    </Canvas>
    <Canvas x:Name="MakePicksCanvas" Canvas.Left="1490" Canvas.Top="321" >
    <Image x:Name="HandiPicks" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/YourPicks.png" />
    <TextBlock x:Name="First" Text="{Binding PlayerPicks[0], FallbackValue=-, Mode=OneWay, StringFormat=N0}" Canvas.Left="120" Canvas.Top="75" Width="24" Height="24" FontSize="24" TextAlignment="Center" Foreground="White" HorizontalAlignment="Stretch" FontFamily="/Frozen7ViewModule;component/Fonts/#Celtic Gaelige"/>
    <TextBlock x:Name="Second" Text="{Binding PlayerPicks[1], FallbackValue=-, Mode=OneWay, StringFormat=N0}" Canvas.Left="120" Canvas.Top="125" Width="24" Height="24" FontSize="24" TextAlignment="Center" Foreground="White" VerticalAlignment="Stretch"/>
    <TextBlock x:Name="Third" Text="{Binding PlayerPicks[2], FallbackValue=-, Mode=OneWay, StringFormat=N0}" Canvas.Left="120" Canvas.Top="175" Width="24" Height="24" FontSize="24" TextAlignment="Center" Foreground="White" HorizontalAlignment="Stretch"/>
    </Canvas>
    <!-- Info Canvas -->
    <Canvas x:Name="InfoCanvas" Canvas.Left="241" Canvas.Top="369" >
    <Image x:Name="InfoIcon" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Info_UI.png" />
    <Rectangle x:Name="InfoHitBox" Width="{Binding ElementName=InfoIcon, Path=ActualWidth}" Height="{Binding ElementName=InfoIcon, Path=ActualHeight}" Fill="Purple" Opacity="0" >
    <i:Interaction.Triggers>
    <i:EventTrigger EventName="MouseLeftButtonDown">
    <i:InvokeCommandAction Command="{Binding ShowInfoCommand, Mode=OneTime}"/>
    </i:EventTrigger>
    </i:Interaction.Triggers>
    </Rectangle>
    </Canvas>
    <!-- Volume Canvas -->
    <Canvas x:Name="VolCanvas" Canvas.Left="241" Canvas.Top="465" >
    <Image x:Name="VolMax" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Volume_High.png"/>
    <Image x:Name="VolMed" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Volume_Med.png" Visibility="Collapsed" />
    <Image x:Name="VolLow" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Volume_Low.png" Visibility="Collapsed" />
    <Rectangle Width="{Binding ActualWidth, ElementName=VolMax}" Height="{Binding ActualHeight, ElementName=VolMax}" Fill="Orange" Opacity="0" >
    <i:Interaction.Behaviors>
    <vwc:VisualStateCycleStateOnEvent EventName="MouseDown" EventOwnerType="{x:Type UIElement}" VisualStateGroupName="VolumeStateGroup"/>
    </i:Interaction.Behaviors>
    </Rectangle>
    </Canvas>
    <!-- Balance Display -->
    <Canvas x:Name="BalanceDisplay" Canvas.Left="357" Canvas.Top="409" DataContext="{Binding Mode=OneTime, RelativeSource={RelativeSource TemplatedParent}}" >
    <Image x:Name="Balance_UI" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Cash_UI.png" />
    <!-- Dynamic Balance Text -->
    <Grid x:Name="BalanaceGrid" Canvas.Left="15" Canvas.Top="15" >
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="0.748*"/>
    <ColumnDefinition Width="0.087*"/>
    <ColumnDefinition Width="0.165*"/>
    </Grid.ColumnDefinitions>
    <!-- Grid must be positioned within this canvas so its in the correct place of the background image -->
    <Grid x:Name="CustomerBalanceCredits" Grid.ColumnSpan="3" Width="230" Height="90" >
    <Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto">
    <TextBlock x:Name="CustomerBalanceNormalCredits" Text="{Binding CustomerBalance.AltAmount, FallbackValue=87\,123\,456, Mode=OneWay, StringFormat=N0}" />
    </Viewbox>
    <Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" >
    <TextBlock x:Name="CustomerBalancePartialCredits" Text="{Binding CustomerBalance.Amount, Converter={vwcc:IntToMoneyConverter}, FallbackValue=$871\,234.56, Mode=OneWay, StringFormat=C}" Visibility="Hidden"/>
    </Viewbox>
    </Grid>
    <Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.ColumnSpan="3" Margin="0" Width="230" Height="90" >
    <TextBlock x:Name="CustomerBalanceMoney" Text="{Binding CustomerBalance.Amount, Converter={vwcc:IntToMoneyConverter}, FallbackValue=$871\,234.56, Mode=OneWay, StringFormat=C}" Visibility="Hidden"/>
    </Viewbox>
    </Grid>
    </Canvas>
    <!-- Win Display -->
    <Canvas x:Name="WinDisplay" Canvas.Left="633" Canvas.Top="348" RenderTransformOrigin="0.5,0.5" DataContext="{Binding Mode=OneTime, RelativeSource={RelativeSource TemplatedParent}}" >
    <Rectangle x:Name="WinBox_SolidBack" Canvas.Left="5" Canvas.Top="5" Width="441" Height="129" Fill="LightBlue" Opacity="0" />
    <Image x:Name="Win_Box" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Win_UI.png" >
    <Image.RenderTransform>
    <TransformGroup>
    <ScaleTransform ScaleX="0.33" ScaleY="0.3" />
    </TransformGroup>
    </Image.RenderTransform>
    </Image>
    <!-- Dynamic Win Text -->
    <!-- Grid must be positioned within this canvas so its in the correct place of the background image -->
    <Grid x:Name="WinGrid" Canvas.Left="15" Canvas.Top="25" Visibility="{Binding ShowWinText, Converter={vwcc:BoolToHiddenConverter} }" >
    <Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="430" Height="120" >
    <TextBlock x:Name="WinAmountCredits" Text="{Binding WinAmount.AltAmount, FallbackValue=123\,456, Mode=OneWay, StringFormat=N0}" FontSize="96"/>
    </Viewbox>
    <Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="430" Height="120" >
    <TextBlock x:Name="WinAmountMoney" Text="{Binding WinAmount.Amount, Converter={vwcc:IntToMoneyConverter}, FallbackValue=$871\,234.56, Mode=OneWay, StringFormat=C}" Visibility="Hidden" FontSize="128"/>
    </Viewbox>
    </Grid>
    <Canvas.RenderTransform>
    <TransformGroup>
    <ScaleTransform ScaleX="1" ScaleY="1" />
    </TransformGroup>
    </Canvas.RenderTransform>
    </Canvas>
    <!-- Bet Display -->
    <Canvas x:Name="BetDisplay" Canvas.Left="1109" Canvas.Top="409">
    <Image x:Name="Bet_UI" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Dashboard/Bet_UI.png" />
    <!-- Dynamic Bet Text -->
    <!-- Grid must be positioned within this canvas so its in the correct place of the background image -->
    <Grid x:Name="BetGrid" Canvas.Left="15" Canvas.Top="15" >
    <Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="230" Height="90" >
    <TextBlock x:Name="BetAmountMoney" Visibility="Hidden" Text="{Binding BetAmount, Converter={vwcc:IntToMoneyConverter}, FallbackValue=$871\,234.56, Mode=OneWay, StringFormat=C}"/>
    </Viewbox>
    <Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Center" Width="230" Height="90" >
    <TextBlock x:Name="BetAmountCredits" Text="{Binding NumberBets, FallbackValue=$871\,234.56, Mode=OneWay, StringFormat=N0}"/>
    </Viewbox>
    </Grid>
    </Canvas>
    <Canvas x:Name="InfoTextCanvas" Canvas.Left="0" Canvas.Top="-473" DataContext="{Binding Mode=OneTime, RelativeSource={RelativeSource TemplatedParent}}" >
    <Image x:Name="PromptBar" Source="pack://siteoforigin:,,,/Frozen7ViewModule/Content/Bottom Screen/Background/PromptBar.png" />
    <Grid Width="1680" Height="62.5" Canvas.Top="8">
    <Grid.Resources>
    <Style BasedOn="{StaticResource {x:Type TextBlock}}" TargetType="{x:Type TextBlock}">
    <Setter Property="FontSize" Value="45"/>
    <Setter Property="Effect">
    <Setter.Value>
    <DropShadowEffect/>
    </Setter.Value>
    </Setter>
    <Setter Property="HorizontalAlignment" Value="Center" />
    </Style>
    </Grid.Resources>
    <!-- Info Prompts???? -->
    <TextBlock x:Name="TBInfoText" Text="{Binding InfoText, Mode=OneWay}" />
    <TextBlock x:Name="TBInfoTextMoney" Text="{Binding InfoTextMoney, Mode=OneWay}" />
    <TextBlock x:Name="PART_TBBonusInfo" Visibility="Collapsed"/>
    </Grid>
    </Canvas>
    <Rectangle x:Name="DisplayBoxesHitBox" Width="1020" Height="200" Fill="Red" Opacity="0" Canvas.Left="350" Canvas.Top="340" Panel.ZIndex="900" >
    <i:Interaction.Behaviors>
    <vwc:VisualStateCycleStateOnEvent EventName="MouseDown" EventOwnerType="{x:Type UIElement}" VisualStateGroupName="ShowValueStateGroup"/>
    </i:Interaction.Behaviors>
    </Rectangle>
    </Canvas>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>
    </ResourceDictionary>
    GameSpecificDashboardControl  CODE BEHIND
    using Common;
    using ViewCommon;
    using ViewCommon.Dashboard;
    using Common.Events.Messages;
    using System;
    using System.Windows.Media.Animation;
    using System.Windows.Controls;
    using System.Windows;
    using System.Windows.Media;
    namespace Frozen7ViewModule.Views
    public class GameSpecificDashboardControl : DashboardControl
    private bool wasBigWin;
    private Storyboard sbBigWinIntro;
    private Storyboard sbBigWinEnd;
    private string _infoTextMoney;
    public string InfoTextMoney
    get { return _infoTextMoney; }
    private set
    _infoTextMoney = value;
    RaisePropertyChanged(() => InfoTextMoney);
    private bool _showWinText;
    public bool ShowWinText
    get { return _showWinText; }
    set
    _showWinText = value;
    RaisePropertyChanged(() => ShowWinText);
    private MultiPaylineControl multiPaylineControl;
    private int creditDivisor;
    public void Initialize(MultiPaylineControl multiPaylineControl)
    this.multiPaylineControl = multiPaylineControl;
    creditDivisor = GameParameters.Fetch.GameBetUnitCost;
    public override void OnApplyTemplate()
    base.OnApplyTemplate();
    sbBigWinIntro = this.LoadResourceStoryboard("sbBigWinIntro");
    sbBigWinEnd = this.LoadResourceStoryboard("sbBigWinEnd");
    public override void ClearPaylineInfo()
    base.ClearPaylineInfo();
    InfoTextMoney = "";
    public override void SetPaylineInfo(string info)
    base.SetPaylineInfo(info);
    InfoTextMoney = info;
    public override void OnPaylineLoop(MessageResultWin.Payline payline, int callCount)
    if (multiPaylineControl.IsJackpotWin() && payline.Tier == 0)
    // With current protocol, the Jackpot win amount is not easily determined for all case, do not try to show it
    InfoTextMoney = string.Format("Payline {0} Pays Jackpot", payline.PaylineIndex + 1);
    InfoText = InfoTextMoney;
    else
    int creditsBet = BoundBetAmount / creditDivisor;
    var creditString = (creditsBet > 2 && payline.Tier < 3) ? string.Format("X {0}", creditsBet - 1) : "";
    var multiplierString = payline.Multiplier > 1 ? string.Format("X {0}", payline.Multiplier) : "";
    string strTier = "(*Payline Tier Missing*)";
    if (payline.Tier >= 3) strTier = "1st Coin:";
    else if (payline.Tier < 3 && payline.Tier >= 0)
    //explicitly check for 2nd and 3rd coin for easier debugging if a bug ever occurs
    if (creditsBet == 2) strTier = "2nd Coin:";
    else if (creditsBet == 3) strTier = "3rd Coin:";
    InfoTextMoney = string.Format("Payline {0} Pays {1} {2:C}", payline.PaylineIndex + 1, strTier, (((double)payline.AmountWon) / 100) * payline.Multiplier);
    InfoText = string.Format("Payline {0} Pays {1} {2:N0}", payline.PaylineIndex + 1, strTier, (payline.AmountWon / creditDivisor) * payline.Multiplier);
    public void StartWinTicker(int bonusWinAmount, Action onBonusTickFinished, Action onWinTickFinished, int adjustAmount,bool isBigWin, bool fast = false)
    base.StartWinTicker(bonusWinAmount, onBonusTickFinished, onWinTickFinished, adjustAmount, fast);
    ShowWinText = true;
    if (isBigWin) sbBigWinIntro.Begin(this);
    wasBigWin = isBigWin;
    public override void OnWinTickFinished()
    base.OnWinTickFinished();
    if (wasBigWin) sbBigWinEnd.Begin();

    I agree with Barry - inheriting xaml is a problem.
    I think there is technically a way to sort of inherit xaml you put in app.xaml.  But I think that's a bad plan and I think the technique may well rely on a bug. Maybe it doesn't even work now - it's been a while since I read about it.
    I'm also not so clear on what you're trying to do here.
    I must admit I haven't spent very long trying to work out what that all that markup and code does though. 
    The three approaches I would consider are:
    1)
    Inherit just the code and substitute views completely.
    This is Barry's suggestion.
    2)
    Make a templated contentcontrol which you can put your variable stuff inside.
    Kind of like this:
    http://social.technet.microsoft.com/wiki/contents/articles/28597.wpf-keeping-your-mvvm-views-dry.aspx
    3)
    Compose the xaml from flat templates.
    https://gallery.technet.microsoft.com/Dynamic-XAML-View-Composer-8d9fa5d6
    https://gallery.technet.microsoft.com/Dynamic-XAML-Composed-View-e087f3c1
    Which to use depends on purpose.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Difference between inheritance and abstract class

    difference between inheritance and abstract class

    See this thread:
    http://forum.java.sun.com/thread.jspa?forumID=24&threadID=663657
    And before Post New Topic, just search in this forums. All most will get answers.

  • For loops & inheritance question

    I am trying this exercise dealing w/inheritance. I enter at command line a random number of c's, s's and m's. for checking,savings and money market. I then parse the string and check for the character. From there I create one of the accounts. then I am supposed to make a report that displays the past 3 months activities. the first account created gets 500 deposit the from there each account after the first gets an additional 400. so it would be: 500,900,1300,etc. Here is what I have so far, but the report part is where I can't figure out exactly how to go about solving it. Thanks in advance.
    public static void main( String args[] ){
         int intDeposit = 500;
         char charTest;
         Object [] objArray = new Object[args[0].length()];
         for ( int j = 0; j < 3; j ++ ){                        System.out.println( "Month " + ( j +1 ) + ":" );
             for( int i = 0; i < args[ 0 ].length(); i ++ ){
              charTest = args[ 0 ].charAt( i );
                         if (charTest == 'c' ){
                  BankAccount at = new  CheckingAccount( intDeposit );
                  objArray=at;
              else if( charTest == 's' ){
              BankAccount at = new SavingsAccount( intDeposit );
              objArray[i]=at;
              else if( charTest == 'm' ){
              BankAccount at = new MoneyMarket( intDeposit );
              objArray[i]=at;
              else{
              System.out.println( "invalid input" );
              }//else
              intDeposit += 400;
              System.out.println();
         }//for j
         for (int counter = 0; counter < objArray.length; counter ++ ){
              System.out.println( "Account Type: " +
                        objArray[counter].toString() );
              System.out.println( "Initial Balance: " +
                        (BankAccount) objArray[counter].getCurrentBalance() );
         System.out.println( "TotalDeposits: " + objArray[counter].getTotalDeposits() );
         System.out.println();
         }//for i
    }//main
    }//TestBankAccount.java\

    The only thing I think is wrong is the following line:
    System.out.println( "Initial Balance: " +                    (BankAccount) objArray[counter].getCurrentBalance() );
    Should be:
    System.out.println( "Initial Balance: " +                    ((BankAccount) objArray[counter]).getCurrentBalance() );

  • Problem with inheritance and outputting values in toString.

    Hey guys, i'm having a major problem with inheritances.
    What i'm trying to do with my program is to create objects in my demo class. Values are passed to several other objects that each do their own calculations of grades and results and then outputs the result in my toString. I followed step by step the instructions in my book on how to setup the inheritance and such. I can only output everything that was created in my superclass, any other thing that was created in an object that belongs to a subclass does not display in the output at all.
    Even if I change or create new instance variables, I can't figure out for the life of myself how to output the other values.
    Because there's so much code to be splitting on the forums, I zipped my whole project in a RAR. I'll link it here
    http://www.4shared.com/file/ZleBitzP/Assign7.html
    The file to run the program is CourseGradesDemo class, everything else is either a subclass or superclass to some part of the program. After you run CourseGradesDemo, you will see the output, and understand what displays and what stays at 0.0 value. If anyone can help me out with this it would be greatly appreciated
    Thanks in advance.

    Basshunter36 wrote:
    Hey guys, i'm having a major problem with inheritances.
    What i'm trying to do with my program is to create objects in my demo class. Values are passed to several other objects that each do their own calculations of grades and results and then outputs the result in my toString. I followed step by step the instructions in my book on how to setup the inheritance and such. I can only output everything that was created in my superclass, any other thing that was created in an object that belongs to a subclass does not display in the output at all.
    Even if I change or create new instance variables, I can't figure out for the life of myself how to output the other values.No idea what you're talking about. Provide an [url http://sscce.org]SSCCE.
    Because there's so much code to be splitting on the forums, I zipped my whole project in a RAR. I'll link it here
    http://www.4shared.com/file/ZleBitzP/Assign7.html
    Not gonna happen. Provide an [url http://sscce.org]SSCCE. And don't say you can't. You definitely can. You may have to spend an hour building a new program from scratch and getting it to reproduce the problem, but if you can't or won't do that, you'll find few people here willing to bother with it.

  • Having a problem with inheritance and a constructor

    i have two classes, i'm just going to give the constructors anyway. I'm having trouble getting the CDImage constructor to inherit something from songs, I believe the instructions are missing something or the cs lab guy misinterpreted them.
    package songs;
    import java.text.*;
    public class Song implements Comparable {
        private int songLength;
        private String artistName;
        private String songName;
        public Song(int songLength, String artistNames, String songName) {
            this.songLength = songLength;
            this.artistName = artistNames;
            this.songName = songName;
        }These are the instructions that i beleive may be incorrect:
    Design a CDImage class to represent a music CD. The constructor takes three parameters: the title of the CD, the recording label, and the number of tracks on the CD. (Each track contains one song.) The CDImage class uses the Song class developed above and should contain methods to accomplish the following:package songs;
    import java.text.*;
    public class CDImage extends Song {
        private String title;
        private String label;
        private int numberTracks;
        private Song[] songs;
        public CDImage(String title, String label, int tracks){
        this.title = title;// this is the album name
        this.label = label;
        numberTracks = tracks;
        songs = new Song [numberTracks];
        }i know i need to use the super modifier under the constructor but how? because nothing in the constructor of the CDImage class refers directly to the constructor in the Song class
    thanks in advance.
    Message was edited by:
    kevin123

    you know whats funny, this project has to do with arrays of objects and not inheritance. We learned inheritance last week but the lab we are doing which is this, is for arrays of objects. sorry for the confusion lol. so you can completely ignore this, it actually has it in big bold letters at the top of the web page for the lab.

  • Issue with Serial number inheritance in PP order

    Hi gurus,
    We have an issue with inheritaning component material serial no. to header material.
    For production order having different header material and component material,on GI, the serial no. assigned to component is inheritated to header material. We can see the serial nos. in order, Header --> Serails Numbers. This functionality has been implemented in BADI 'MB_MIGO_BADI' method POST_DOCUMENT' using FM 'SERNR_ADD_TO_DOCUMENT'.
    But, the issue is when the production order is having same header and component material. And on GI, the serial no. is not getting inherited into header material ie., the serial nos. are not visible in production order ,Header --> Serial Number.
    Is there any other FM for handling the serial numbers for order having having same header and component material?
    Note: The material is serialized material.
    Thanks & Regards,
    Chandra Sekhar.

    Tried the "live" chat. What a waste of time:
    Thank you for choosing Adobe. A representative will be with you shortly. Your estimated wait time is 0 minute(s) and 54 second(s) or longer as there are 1 customer(s) in line ahead of you.
    You are now chatting with Farook.
    Farook: Hello! Welcome to Adobe Customer Service.
    Farook: Please allow me a moment to review your request.
    Farook: Hi Martin.
    Martin: Hi.
    Martin: For reference the serial number is <deleted>
    Martin: Purchased from Amazon.co.uk in January.
    Farook: I understand that you are unable to install the software. Am I correct?
    Martin: No. I installed it, activated it fine on my laptop but when I tried to do the same on my desktop PC the serial number conflictr was detected and both are now blocked.
    Martin: Farook, I suspect you won't find this in your FAQs, since it isn't on the support website. Can you escalate?
    Farook: I am sorry to hear that.
    Farook: Can I have your full name and email address?
    Martin: Martin Lampard
    Martin: <deleted>
    Farook: Thank you.
    Farook: Martin, I am sorry, the serial number which you have provided has not registered with.
    Farook: Hence, you need to contact Amazon.
    Martin: Rubbish. I had activated it on my laptop. I am 100% certain.
    Farook: I understand Martin.
    Martin: How did you check the serial number?
    Farook: Could you please re-confirm me the serial number?
    Martin: <deleted>
    Farook: Thank you.
    Farook: Martin, I am sorry, you need to contact Amazon.com.
    Farook: I am sorry for the inconvenience caused to you.
    Martin: Why? They sold me a working copy of Dreamweaver.
    Farook: I understand, but I do not have enough resources to help you further.
    Farook: Please contact Amazon.com.
    Martin: What a waste of time. Makes me sorry I bought this Adobe product.

  • HT201441 Inherited an ipad from a friend passing away and cant clear it to use as i dont have her itunes password to reset.

    I inherited an ipad 2 from a friend that had passed away. I went to go and use and discovered that no one knew her password for her itunes account. Which poses a problem as i cannot wipe the ipad without it.

    I cannot find "Other" devices. I found Apple Mobile Device under Universal Bus Controllers but cannot see "recovery mode" or any other status. I use Windows Vista.
    When I try to restart Apple Mobile Device Service I get the following message: "The Apple Mobile Device Service on Local Computer started then stopped. Some services stop automatically if they are not in use by other services or programs". What does this mean?
    During the last 48 hours I was able to see my iPad in iTunes only one time during many attemnpts to connect . I haven't been able to see it during the llast several attempts.
    Any suggestions? The standard suggestions have not worked: i.e. stop then start AMDS; tuurn off iPad and PC, then restart both and reconfrom iPad to PC; reload iTunes.

  • I have inherited my partners old iPhone and iPad. I have successfully opened an iTunes a/c for myself on the iPad and I phone, but I cannot get change the identities on iCloud, which are still in my partners name.

    I have inherited my partner's old iPhone and iPad. I have successfully created a new iTunes account and got my user name and passwords accepted on both devices. However, I don't know how to change the user details for iCloud on the iPhone. I have done it (I think!!) on the iPad but would appreciate any help for getting my details for iCloud onto the iPhone so I can start sharing photos between the two devices.

    Welcome to the Apple Community.
    In order to change your Apple ID or password for your iCloud account on your iOS device, you need to delete the account from your iOS device first, then add it back using your updated details. (Settings > iCloud, scroll down and hit "Delete Account")
    In order to change your Apple ID or password for your iTunes account on your iOS device, you need to sign out from your iOS device first, then sign back in using your updated details. (Settings > store, scroll down and tap your ID)

  • I just inherited a 64GB ipad. I have passwords for the deceased person but would like to sync it with my mac osx.  Know nothing about ipads. Help please

    I just inherited a 64 GB ipad.  I have passwords for the deceased person but would like to reset everything and start new. I use a mac/0SX but know nothing about an ipad other than turning it on.  I am in the same household as the deceased person but does not seem to be recognizing the wireless setup.  Any help would be appreciated. Any recommendations as to where to start.

    That's really enough information. You can update this iPad to iOS 6.1.2. If there is a microphone icon next to the space bar on the keyboard, you have an iPad 3. But if you are saying that it hasn't been touched for over a year, it probably is not the iPad 3. The iPad 3 is one year old this week IIRC.
    If you want, you can go to Settings >General>About>Model to find the model number and it you Google that, you can find out which version of the iPad it is.
    I just wanted to see what iOS you would be able to update to. I'm not sure what else to tell you other than what we've already stated. You should set this up as new, update the iOS and then start all over again with you own iTunes content.
    The link that Eric posted would be a good place to start so that you can get an idea of what the iPad can do. If you want to restore the iPad back to factory settings, you will need to do this with iTunes on your Mac. You must be running OS X 10.6.8 at minimum and must be using iTunes 10.6.3 (I think) in order to syn with iTunes on the Mac.
    This explains how to restore to factory settings.
    http://support.apple.com/kb/ht1414
    if you are that uncomfortable trying to do this on your own, and if there is an Apple Store near you, make an appointment at an Apple Store Genius Bar and ask an Apple tech to help you with it. That is what they do. There is no charge for an Apple Store Genius Bar visit. The stores also offer classes for the iPad that you might find useful as well.

  • How should inheritance of permissions on AD behave?

    Hi Forum members, I am not an AD expert in fact far from it. We have an in house software and we have used Active Directory to authenticate NT accounts to login to our application. In our application we can configure/setup AD groups in such a way that those
    group members can get access to specific features and servers in our application. Please see my situation described below:-
    I have the following config in place in my application:
    LondonGroup (a user group, as present in AD) can manage HR Module of server LondonServer.
    BirminghamGroup (as present in AD) can manage Finance Module of server BirminghamServer.
    So when a user of AD group LondonGroup logs in to our application, he/she can manage the HR module on LondonServer. Similarly when an user of BirminghamGroup logs in, he/she can manage Finance module on BirminghamServer. That's all fine. The issue arises
    when someone in AD makes BirminghamGroup a sub group of LondonGroup i.e. BirminghamGroup is a member of LondonGroup. When this is setup, when a user of AD group LondonGroup logs in to our application, he/she can manage the HR module on LondonServer -
    which is still fine BUT when a user of BirminghamGroup logs in he/she can now access HR and Finance modules of both LondonServer and BirminghamServer!! This could be because we support inheritance feature of AD where a sub group should get all access permissions
    from its parent group. But is this a problem? for e.g in our application we never set up BirminghamGroup to get access to HR module on LondonServer! 
    so my question is:
    1) Is this expected behaviour from AD point of view? Is this because the Group setup on the AD is wrong (but there is nothing stopping users to do this)
    2) Our application looks for the configured Groups and then traverses down the tree to locate the user and on the way additively gives access rights - is this a wrong implementation?
    Sorry for the long story but any guidance will be highly appreciated.

    1) Is this expected behaviour from AD point of view? Is this because the Group setup on the AD is wrong (but there is nothing stopping users to do this)
    2) Our application looks for the configured Groups and then traverses down the tree to locate the user and on the way additively gives access rights - is this a wrong implementation?
    Yes This is by design. There is nothing wrong in it. As Pierre mentioned it is called 'Group Nesting'.
    I believe your application is following the concepts of 'Group Nesting' which is fine. It is behaving properly.
    If you would like to not to have these sort of traversing in your application, you need to isolate the user accounts of being member in 'Nested Groups'.
    Mahdi Tehrani   |  
      |  
    www.mahditehrani.ir
    Please click on Propose As Answer or to mark this post as
    and helpful for other people.
    This posting is provided AS-IS with no warranties, and confers no rights.
    How to query members of 'Local Administrators' group in all computers?

  • I have inherited an ICloud account from one of my employers when transferring from old MacBook Pro to new MacMini and need to separate from this, presumably by setting up a new ICloud account.  How do I do this ?

    I have inherited an ICloud account from one of my employers when transferring from old MacBook Pro (which belonged to them) to new MacMini and need to separate from this, presumably by setting up a new ICloud account.  How do I do this ?  And is there any danger, in doing so, that I might delete any of her ICloud information ?

    Sign out in System Preferences>iCloud. This will remove any synced data such as Calendars, emails and Contacts from your Mac, but will have no effect on the data on the server - so that other devices logged into it will continue to see the data.

Maybe you are looking for

  • How do I set up my printer to only print in black?

    how do I set up my printer to only print in black?

  • Goods issue for plant maintenance order

    Goods issue with ref to plant maintenance order( Componenets of the order) is not possible in transaction code MIGO. Error message " MIGO is not possible for the refurbishment order". Goods issue for the same order can be posted with transaction MB!A

  • Web gallery does not work

    Hi, Problem that I have ... is  difficult to explain so picture : As you see when I click under the web gallery  and I selected a flash galery or imported web galley (exemple here is airtight simpleviewver...) ... the screen in the middle box keeping

  • Wireless keyboard for warranty

    I bought a Apple Wireless Keyboard Model A1314, these two days, some of key not response correctly, and when I try use Send in for Service,I keyed in  keyboard serial number  got a error "Please enter a valid hardware serial number, excluding accesso

  • Aggregate functions, %notfound and group by

    Hi, Below are 2 versions of a script that query the employees table and get the max salary by specific departments. Department ids are held in a varray. With 'group by': declare     type c is ref cursor;     c1 c;     sal employees.salary%type;     t