我正在学习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) 由于某种原因,我的数学只返回0.值已设置,我已检查.
int currentSize = 4079;
int totalSize = 500802;
int percentage = ((currentSize/totalSize) * 100);
progdialog.setProgress(percentage);
Run Code Online (Sandbox Code Playgroud)
百分比总是等于百分比.为什么?
我如何回答诸如"以下表达式评估为什么"之类的问题.
"2 + 2 " + 3 + 4;
Run Code Online (Sandbox Code Playgroud)
因为我在网站练习上真的很难 - 并尝试了从2234到11的所有可能的答案.