小编ani*_*nil的帖子

将字符串拆分为char并在C#中添加"......"

我想将一个字符串拆分为char

那是我的字符串

"非常好的网站堆栈溢出"

我想转换这个字符串

喜欢

第一个单词和第二个单词分成字符

.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..溢出...... .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. …

.net c# visual-studio-2010

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

错误:无法在Windows 7中找到或加载主类hello

我是一名新的java学生,我在命令提示符下运行hello world程序,但是我收到了一个错误

  class hello{

public static void main(String agrs[]){
 system.out.println("Hello world");
}

}
Run Code Online (Sandbox Code Playgroud)

这是我的hello world program

G:\java>javac hello.java



 G:\java>dir
 Volume in drive G has no label.
 Volume Serial Number is 32DF-BA6B

 Directory of G:\java

14-Sep-13  04:36 PM    <DIR>          .
14-Sep-13  04:36 PM    <DIR>          ..
14-Sep-13  04:36 PM               415 hello.class
14-Sep-13  04:35 PM               100 hello.java
               2 File(s)            515 bytes
               2 Dir(s)  55,645,966,336 bytes free
G:\java>java hello
Error: Could not find or load main class hello
Run Code Online (Sandbox Code Playgroud)

我的java路径是对的

G:\java>path
PATH=G:\Windows\system32;G:\Windows;G:\Windows\System32\Wbem;G:\Windows\System32
\WindowsPowerShell\v1.0\;G:\Program Files\Java\jdk1.7.0_25\bin
Run Code Online (Sandbox Code Playgroud)

但是什么时候使用这个命令然后程序运行. …

java

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

访问java中静态方法中的非静态数据

我是一个新的java学习者,我正在制作一个程序,我想在静态方法中访问非静态数据成员的值,但规则说我不能这样做但我们可以在创建一个对象后访问它我的问题是如果我使该类的对象,该数据成员的旧值被擦除为什么?我怎样才能在静态方法中使用静态数据成员的旧值

import java.util.Scanner;
class emp
{
     String name;
     int rate;
     static String c_name="TCS";


     void setdata(String n,int s)

     {
       name=n;
       rate=s;  

     }
     static void employee_salary_cal(int t)
      {
        int day,rate1,Total;
        day=t;
        emp e2=new emp();
        rate1=e2.rate;
        Total=rate1*day;

        System.out.println("Total salary " +Total);
      }  

     void showData()
     {
       System.out.println("Employee name = " +name);
       System.out.println("Employee pay rate per day = " +rate);
     }


}

class emp_main
{
  public static void main(String args[])
     { 
        int da;
        emp e1=new emp();
        e1.setdata("alex",100);
        System.out.println("Company name = " +emp.c_name);
        e1.showData();
        System.out.println("Enter Work …
Run Code Online (Sandbox Code Playgroud)

java

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

为什么我的数据类型不会自动提升为Double

我知道数据类型会自动提升到上层数据类型byte-short-int

class Temp {
    void check(byte x) {
        System.out.println(x + " is the byte type");
    }

    void check(short x) {
        System.out.println(x + " is the short type");
    }

    void check(int x) {
        System.out.println(x + " is the int type");
        int y = x;
        System.out.println(y + " is the int type");
    }

    void check(long x) {
        System.out.println(x + " is the long type");
    }

    void check(float x) {
        System.out.println(x + " is the float type");
    }

    void check(double x) {
        System.out.println(x …
Run Code Online (Sandbox Code Playgroud)

java java-ee

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

标签 统计

java ×3

.net ×1

c# ×1

java-ee ×1

visual-studio-2010 ×1