它编译但不是ru。它们在线程“main”中显示异常。 java.lang.noclassfounder错误:for [英] Its compiled but not ru them .it show exception in thread "main" java.lang.noclassfounder error:for

查看:88
本文介绍了它编译但不是ru。它们在线程“main”中显示异常。 java.lang.noclassfounder错误:for的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

显示1至5的值

  import  java.io. *; 
class K {
public static void main( String args [])
{
int i;
for (i = 0; i< 5; i ++)
{

System.out.println(< span class =code-string> + i);
}
}
}





我尝试了什么:



import java.io. *;

class K {

public static void main(String args [ ])

{

int i;

for(i = 0; i< 5; i ++)

{



System.out.println(+ i);

}

}

}

解决方案



我在我的地方尝试了相同的pgm,但它在这里运行并输出为好。

show the values on 1 to 5

import java.io.*;
class K {
    public static void main(String args[])
    {  
        int i;
        for(i=0;i<5;i++)
        {
        
            System.out.println(" "+i);
        }
    }
}



What I have tried:

import java.io.*;
class K{
public static void main(String args[])
{
int i;
for(i=0;i<5;i++)
{

System.out.println(" "+i);
}
}
}

解决方案

Hi,
I have tried the same pgm at my place but its running here and giving output as well.


这篇关于它编译但不是ru。它们在线程“main”中显示异常。 java.lang.noclassfounder错误:for的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆