小编Bry*_*yan的帖子

在PHP中扩展抽象类时出现致命错误

我正在学习OOP PHP的高级水平..(或者我想学习:))

是我的代码.

摘抄:

<?php 
abstract class Karakter
{
    abstract public function isim($name);
    abstract public function yas($age);

    public function yazdir()
    {
        print $this->isim() . " " . $this->yas();
    }
}

class Insan extends Karakter
{
    public $isim;
    public $yas;
    public function isim()
    {
        return "Bu adam?n ismi: " . $this->isim;
    }

    public function yas()
    {
        return "Bu adam?n ya??: " . $this->yas;
    }
}
Run Code Online (Sandbox Code Playgroud)

当我运行此代码时,我无法赢得通过.我可以看到这个错误:

Fatal error: Declaration of Insan::isim() must be compatible with that of Karakter::isim() in C:\AppServ\www\OOP\1.php …
Run Code Online (Sandbox Code Playgroud)

php abstract-class

3
推荐指数
1
解决办法
386
查看次数

Java divison有两个整数操作数不起作用?

由于某种原因,我的数学只返回0.值已设置,我已检查.

int currentSize = 4079;
int totalSize = 500802;

int percentage = ((currentSize/totalSize) * 100);
progdialog.setProgress(percentage);
Run Code Online (Sandbox Code Playgroud)

百分比总是等于百分比.为什么?

java math

1
推荐指数
1
解决办法
4688
查看次数

Java算术中的字符串(评估混合类型表达式)

我如何回答诸如"以下表达式评估为什么"之类的问题.

"2 + 2 " + 3 + 4; 
Run Code Online (Sandbox Code Playgroud)

因为我在网站练习上真的很难 - 并尝试了从223411的所有可能的答案.

java string math

1
推荐指数
1
解决办法
6589
查看次数

标签 统计

java ×2

math ×2

abstract-class ×1

php ×1

string ×1