java string传递_Java,将String从一种方法传递到另一种方法

我希望有人能够帮助我,我需要从下面的方法传递一个字符串到下面的方法。我已经看过interent,并开始测试程序,但似乎无法让我的工作,它已经3个小时,3页谷歌和一本书哈哈。对不起,如果这很容易,但我真的不知道。

我需要做的是......我需要将方法“WMDBAudio”中的变量“Hex”传递给方法“hexConverter”。我希望这是有道理的,感谢您提前给予的帮助,它已经过去了!

public class WMDBAudio{

public String WMDBAudio1(String fileInfo) throws IOException{

//code removed as there is quite a lot

int m = 0;

while (m != 1){

for (int count = 0; count < 3; count++){

hexIn = in.read();

s = Integer.toHexString(hexIn);

if(s.length() < 2){

s = "0" + Integer.toHexString(hexIn);

}

temp = temp + s;

}

if ("000000".equalsIgnoreCase(temp)){

m = 1;

hex = entry;

}

entry = entry + temp;

temp = "";

}

}

}// Hex Converter方法

public class hexConverter{

public static void hexConverter(String t){

WMDBAudio w = new WMDBAudio();

String hex = "";

StringBuilder output = new StringBuilder();

for (int i = 0; i < hex.length(); i+=2){

String str = hex.substring(i, i+2);

output.append((char)Integer.parseInt(str, 16));

}

System.out.println(output);

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值