Helpin OOP
Please I need help solving this Oval and FilledOval code by changing the instance variables in Oval that are in public, which is not optimal, to private and re-implement any code that depended on the public accessibility of those instance variables. Here is the code:
import java.awt.*;
public class Oval {
public int x, y, w, h;
public Oval(int x, int y, int w, int h) {
this.x = x; this.y = y; this.w = w; this.h = h;
}
public void draw(Graphics g) {
g.drawOval(x,y,w,h;
}
public int getWidth() { return w; }
public int getHeight() { return h; }
public Point getTopLeftPoint() { return new Point(x,y); }
//...other methods...
}
public class FilledOval extends Oval
{
public FilledOval(int x, int y, int w, int h)
{ super(x, y, w, h); }
public void draw(Graphics g)
{
g.fillOval(x, y, w, h);
}
}
View Answers
Related Tutorials/Questions & Answers:
Helpin OOPHelpin OOP Please I need help solving this Oval and FilledOval code by changing the instance variables in Oval that are in public, which is not optimal, to private and re-implement any code that depended on the public
oop conceptoop concept why Object class is super class for all class?
1.to use the Object class methods in subclass directly
or
2.the Object class is usefull at the time of object create of subclass
what
Advertisements
php oop functionsphp
oop functions Just a quick question... php
oop functions. can i call the main class function from an instantiated object of the child class
PHP OOP ConceptsPHP
OOP Concepts
Object Oriented Programming is a paradigm which is nowadays the most popular way to develop any application and most of the modern day language is based on this paradigm.
OOP or Object Oriented Programming PHP has
ModuleNotFoundError: No module named 'oop-ext'ModuleNotFoundError: No module named '
oop-ext' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
oop-ext'
How to remove the ModuleNotFoundError: No module named '
oop-ext
OOP JAVa - Java Interview QuestionsOOP JAVa Is java is 100%
OOP.?Plz giv full explanation. hi Sanjay,dis is Srinivas(MCA from Andhra University).....Java is not an 100 % OOPL,because of the availability of Primitive Data Types
oop answers - Java Beginnersoop answers Consider the following declarations:
{
private int u;
private double w;
public XClass()
{
}
public XClass(int a, double b)
{
}
public void func()
{
}
public void print()
{
}
}
XClass
OOP questions - Java BeginnersOOP questions Consider the following declarations:
{
private int u;
private double w;
public XClass()
{
}
public XClass(int a, double b)
{
}
public void func()
{
}
public void print
OOP - Java BeginnersOOP i have problem with
OOP hope u'll help me write a program that allows the user to enter student' names followed by their test scores and outputs the following information (assume that the maximum number of students
OOP questions - Java BeginnersOOP questions Consider the following declarations:
{
private int u;
private double w;
public XClass()
{
}
public XClass(int a, double b)
{
}
public void func()
{
}
public void print
OOP with Java - Java BeginnersOOP with Java I had a look at the solution for the answers, in the website already, but my lecturer wants us to do it in another method. Here goes...) {
Question2
q = new Question2();
q.buildSeats();
q.printSeats
OOP with Java 2 - Java BeginnersOOP with Java 2 Define a class called BogEntry that could be used to store an entry for a Web log. The class should have member variables to store the poster's username, text of entry, and the date of the entry using the Date
OOP using Java - Java BeginnersOOP using Java Can you write a Java statement that creates the object mysteryClock of the Clock type, and initialize the instance variables hr,min,and sec of mysteryClock to 7, 18, and 39, respectively.
thank you!!!
OOP Using JAVA - Java BeginnersOOP Using JAVA OBJECT ORIENTED PROGRAMMING USING JAVA
(hope guys u will help me please i need your help,thank you so much)
Create a Java program for a class named Money that contains data members.This class is used
OOP with Java 3 - Java BeginnersOOP with Java 3 Write a Temperature class that has two instances variables: temperature value (a floating-point number) and a character for the scale, wither C for Celsius or F for Fahrenheit. the class should have four
OOP with Java-Array - Java BeginnersOOP with Java-Array Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numberings as follows:
1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
6 A B C D
7
registration form using oop conceptregistration form using
oop concept I would like to write a program student registration form at kindergartens and display the information of students that register to the kindergarten. How to make the form and display
PHP OOP NamespaceNamespace in PHP:
The term namespace is very much common in
OOP based language, basically it is a collection of classes, objects and functions.
Namespaces.... The namespace should always declare on the top of the page.
PHP
OOP Namespace
Java with OOP assignment (Eclipse) - Java BeginnersJava with
OOP assignment (Eclipse) "THREE Ts GAME"
*Description*
A "tic-tac-toe" game is a two player's board game where the game board is made of 3 X 3 grids. The two players, one being assigned with 'O' and the other
OOP
OOP
OOPs stands for Object oriented Programming. Previously we used to
follow.../beginners/
oop-in-java.shtmlADS_TO_REPLACE_1