0% found this document useful (0 votes)
24 views

Lab 088

This document defines an abstract class F with private and protected string, double, long, and byte fields. It contains a constructor to set these fields and methods to get the string and double values. It also defines an abstract method verObjeto. A subclass G inherits from F, overrides verObjeto to print the field values, and adds an int field. A TesterClass contains the main method that creates a G object and calls verObjeto.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Lab 088

This document defines an abstract class F with private and protected string, double, long, and byte fields. It contains a constructor to set these fields and methods to get the string and double values. It also defines an abstract method verObjeto. A subclass G inherits from F, overrides verObjeto to print the field values, and adds an int field. A TesterClass contains the main method that creates a G object and calls verObjeto.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LabCSharp08
{
abstract class F
{
private string x = "Ferreiras, Castro";
private double y = 12.34e+12;
protected long z = 987364354;
protected byte w = 34;

public F(string x, double y, long z, byte w)


{
this.x = x;
this.y = y;
this.z = z;
this.w = w;
}

public string getX() { return x; }


public double getY() { return y; }

public abstract void verObjeto();


}

class G: F
{
public G()
{

}
private int s = 9998833;

public override void verObjeto()


{
Console.WriteLine("\nX ="+base.getX()+"\nY ="+ base.getY()+"\nZ
="+z+"\nW ="+w+"\nS ="+s+"\n");
}
}

class TesterClass
{
static void Main(string[] args)
{

G cl = new G();
cl.verObjeto();

Console.ReadKey();
}
}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy