[Solved] Accessing a function from a module

EDIT: You’re actually not having a python issue but a bash one. You’re running your python script as if it were bash (hence the ‘from: can’t read from’), did you put #!/usr/bin/env python at the beginning of the file you’re running (not print_text.py, the other one)? You could alternatively call it that way: python myfile.py … Read more

[Solved] class inheritance java

public class Main { int x=25; int y =25; //Go to next class second aMethod(){ Second s = new Second(); s.manipulateValues(x,y); } } public class Second { //inherit values of x and y //manipulate values //Go to next class third public void manipulateValues(int x, int y){ //manipulate here Third t = new Third (); s.manipulateHereToo(x,y); … Read more

[Solved] Can’t seems to inherit a protected variable

Yes, a B can access protected members of an A. But it’s the fact that you’re going through v3 that makes it essentially irrelevant that this attempt is made from within a member function of B. It’s v3 trying to make the access, not B::calculate, and v3 is not a B&. [C++11: 11.4/1]: [..] All … Read more

[Solved] Needing help understanding piece of Java code

On your class DVDPlayer you chose to say that a regular DVDPlayer cannot record. So you set it to false. If you want it to record you either change the variable directly, like you did on the class DVDPlayerTestDrive. The boolean canRecord = false is only meant to show you that it is possible to … Read more

[Solved] How to debug this my Class in php

the only problem I see is the way youre accessing your method: $myLogIn = new Hos_LoginStatus(); $signedInName->getUserSignedIn(); $signedInName is not defined anywhere, it should be: $myLogIn = new Hos_LoginStatus(); $signedInName = $myLogIn->getUserSignedIn(); You should probably turn error_reporting on in order to see encountered errors. 1 solved How to debug this my Class in php

[Solved] Java graphs not appearing

I have learned that extending JFrame and JPanel is bad But if you need to draw in the GUI, you often need to extend JPanel, and that’s exactly what you should do here. For example the code where you draw with a Graphics object should be inside of the JPanel’s protected void paintComponent(Graphics g) method. … Read more

[Solved] I’m not understanding what the error comment is trying to tell me

Change public Circle(radius,x, y){ this(5, 3, 6); } To public Circle(int radius,int x, int y){ //need to add types to parameters this.radius=radius; this.x=x; this.y=y; } Or if you plan to use 5,3,6 as constant values add public Circle(){ this.radius=5; this.x=3; this.y=6; } 1 solved I’m not understanding what the error comment is trying to tell … Read more