15 Topics

Member Avatar for
Member Avatar for Doogledude123

I know you can create nested classed (or just classes declared outside of the class in the same file) but what is the point of doing this? Why not just create a new class file?

Member Avatar for JamesCherrill
0
196
Member Avatar for Derek_4

I am working on a project in BlueJ which I have to add an "Event Post" to a simple social network project. I have created the project but I am unsure how to take a string, such as "message", from a subclass of the Class Post and print it the …

Member Avatar for Phaelax
0
219
Member Avatar for asteriskLMNOP

Please bear with me, this is my first post So, I have this superclass called A. And I've 2 subclasses A1 and A2. A has attribute name. A has function toString(). A1 inherits name, and has attribute hair. A1 has a method toString() which goes: string A1::toString(){ string stringA= A::toString(); …

Member Avatar for ravenous
0
1K
Member Avatar for rahul.ch

<? super Animal> means animal or it's superclass only. Then why inside the method it's allowing to add Dog object even though it's a subclass of Animal? This program compiles and runs! import java.util.*; class Cat {} class Animal{Animal() {System.out.println("Animal constructor");}} class Dog extends Animal{Dog() {System.out.println("Dog constructor");}} public class GenericDemo5 …

Member Avatar for rahul.ch
0
334
Member Avatar for rahul.ch

General rules is that: 1) A private method cannot be overridden. 2) Subclass method should be a lower access modifier than a overridden superclass method. But the output of the program is "I am Son". Why? Is it because of the rule 2 the output comes? If that's the case …

Member Avatar for JamesCherrill
0
202
Member Avatar for Tortura

Hey, following Problem: I have two classes Measurement and its subclass DC_Measurement. Measurement has a method called: [CODE]public virtual SetPoint[,] createSetPointArray()[/CODE] DC_Measurement: [CODE]public override DCSetPoint[,] createSetPointArray()[/CODE] DCSetPoint is also a subclass of SetPoint. I read that this is possible. Now I use in my mainWindow following code which contains an …

Member Avatar for Tortura
0
154
Member Avatar for kishishi

How can i run my Subclass where my GUI code are written from my Main Class?What codes should i write in my main class??Here are my codes: Main Class: my main class is blank because i really dont know what to write. [CODE] */ package classpkg; /** * * @author …

Member Avatar for sabin_chirila
0
450
Member Avatar for AycheKay

My images contained inside a tags have blue borders around them. How do I get rid of these borders? Here's what I've been trying and it doesn't work: [CODE]#gallery .a .img { border-style: none; }[/CODE]

Member Avatar for AycheKay
0
95
Member Avatar for Tsunami49

Hi there. I am currently trying to get my head around using classes across two files. I currently have a super class and a sub class stored in a file and the main function in another. When I try and pass arguments to the class they work fine if the …

Member Avatar for Tsunami49
0
135
Member Avatar for cac186

I am wanting to reference an object of type JTextField and convert it to JFormattedTextField. Is it possible to convert to a subclass? I tried coding something to the affect of [CODE]ClassA.object = new JFormattedTextField(); ClassA.object.setValue(new Integer(number)); [/CODE] But no success. Any suggestions?

Member Avatar for NormR1
0
133
Member Avatar for majestic0110

I just wanted to demonstrate a quick point regarding Constructors & inheritance. Look at these two classes and think about what you might expect to see after the main method has run. Notice that ClassB is a subclass (inherits from) of ClassA. So, what do we expect the output to …

Member Avatar for masijade
3
578
Member Avatar for onurozcelik

Hi everyone I have system that has classes derived from QGraphicsWidget. I manage derived class objects in layouts on QGraphicsScene. Now I need a compound item that contain two or more QGraphicsWidget in it and also I need to put that item inside my layout. So I choose QGraphicsItemGroup and …

Member Avatar for onurozcelik
0
198
Member Avatar for jonyb222

Good evening Daniweb, I have another idiotic problem which comes from making an arrival subclass out of Event. I have a few other subclasses of Event and they aren't giving me any trouble. I have tried to copy/paste/rewrite to eliminate any stupid typos. Arrival.h:7: error: expected class-name before ‘{’ token …

Member Avatar for jonyb222
0
546
Member Avatar for blur_guava

i everybody, I am required to find out if the following is a standard practice to create a subclass. Take for instance, I have to create a class library (ClLib) with 2 classes using Visual Studio: Class1.cs &amp; Class2.cs. Next, I open up the .CSPROJ file of ClLib and modify …

Member Avatar for blur_guava
0
229
Member Avatar for ehsantl

Hello folks I'm trying to do my assignment and I'm really stuck in! I have to classes..Customer and Pensioner (Customer = Super class and Pensioner = Subclass) The Pensioner has a PensionNo extra than Customer class. I have to make a array of Customer class (for 10) and put Customer …

Member Avatar for rbv
3
295

The End.