老師給我看看!我做完了怎么不顯示結(jié)果?。≈x謝!
我做完了怎么不顯示結(jié)果啊
package com.imooc;
public class Imooc {
????? //屬性(成員變量)
??????? float screen;
?????????? float cpu;
?????????? float mem;
????? //方法
?????????? void call(){
??????? ??? System.out.println(123456);
?????????? }
?????????? void tcall(){
??????? ??? System.out.println("screen:"+screen+"cpu:"+cpu+"mem"+mem);
?????????? }
??????????
}
package com.imooc;
public class ABC {
????????? public static void mian(String[]args){
??????? ?? Imooc qwe=new Imooc();
??????? ?? qwe.tcall();
????????? }
}
2015-12-20
同一個(gè)項(xiàng)目下創(chuàng)建兩個(gè)類 放在eclipse里面沒有問題 可以顯示!
2015-12-20
public class Imooc?
{
? ? ? //屬性(成員變量)
? ? ? ? ? ?float screen;
? ? ? ? ? ?float cpu;
? ? ? ? ? ?float mem;
? ? ? //方法 ?第一種:
? ? ? ? ? ?public void call()
? ? ? ? ? ?{
? ? ? ? ? ? System.out.println("123456");
? ? ? ? ? ?}
? ? ? ? ? ?public void tcall(double newScreen,double newCpu,double newMem)
? ? ? ? ? ?{
? ? ? ? ? ? System.out.println("screen:"+newScreen+"cpu:"+newCpu+"mem"+newMem);
? ? ? ? ? ?} ??
??
? ? ? ? ? ?public static void main(String[]args)
? ? ? ? ? ?{
? ? ? ? ? ? ?Imooc qwe=new Imooc();
? ? ? ? ? ? ? qwe.tcall(4.0,5.0,6.0);
? ? ? ? ? ?}
? ? ? ? ? ?/*第二種:使用內(nèi)部類,將方法定義在類中
? ? ? ? ? ? * public class inter
? ? ? ? ? ?{
? ? ? ? ? public void call()
? ? ? ? ? ? ? ?{
? ? ? ? ? ? ? ? System.out.println("123456");
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?public void tcall(double newScreen,double newCpu,double newMem)
? ? ? ? ? ? ? ?{
? ? ? ? ? ? ? ? System.out.println("screen:"+newScreen+"cpu:"+newCpu+"mem"+newMem);
? ? ? ? ? ? ? ?}
? ?
? ? ? ? ? ?}
? ? ? ? ? ?public static void main(String[]args)
? ? ? ? ? ?{
? ? ? ? ? ? ?Imooc qwe=new Imooc();
? ? ? ? ? ? ?inter inn=qwe.new inter();
? ? ? ? ? ? ?inter.tcall(4.0,5.0,6.0);
? ? ? ? ? ?}
? ? ? ? ? ?*/ ? ? ? ? ?
}
? ??
2015-12-20
public static void mian(String[]args)
?main 寫錯(cuò)了