哪位高手来帮帮我,几个JAVA的小程序,帮我看看是哪里出错了,要详细的哦!!!
RT1....publicclassExperiment2_2{publicstaticvoidmain(Stringargs[]){floatf=3.14159;dou...
RT
1....
public class Experiment2_2
{public static void main(String args[ ])
{float f=3.14159;
double d=123456789.123456789;
double e=-1.23456789e4;
System.out.println("f="+f);
System.out.println("d="+d);
System.out.println("e="+e);
System.out.println("f="+(___)f);
System.out.println("d="+(___)d);
System.out.println("e="+(___)e);
System.out.println("f="+(___)f);
System.out.println("d="+(___)d);
System.out.println("e="+(___)e);
}
}
2.....
public class Experiment2_1
{public static void main(String args[ ])
{int i=1234;
long l=12345678901234;
float f=3.14159;
System.out.println("i="+i);
System.out.println("l="+l);
System.out.println("f="+f);
System.out.println("i="+(long)i);
System.out.println("l="+(int)l);
System.out.println("f="+(int)f);
}
}
3....
public class Experiment2_4
{public static void main(String args[ ])
{___________; //声明一个整型变量i,并赋值为33333.
System.out.println("i="+i); //直接输出整型数i
System.out.println("i="+__); //输出i为长整型
_____________________; //输出i为单精度型
_____________________; //输出i为双精度型
_____________________; //输出i为字符型
有高手的帮帮我,万分感谢啊 展开
1....
public class Experiment2_2
{public static void main(String args[ ])
{float f=3.14159;
double d=123456789.123456789;
double e=-1.23456789e4;
System.out.println("f="+f);
System.out.println("d="+d);
System.out.println("e="+e);
System.out.println("f="+(___)f);
System.out.println("d="+(___)d);
System.out.println("e="+(___)e);
System.out.println("f="+(___)f);
System.out.println("d="+(___)d);
System.out.println("e="+(___)e);
}
}
2.....
public class Experiment2_1
{public static void main(String args[ ])
{int i=1234;
long l=12345678901234;
float f=3.14159;
System.out.println("i="+i);
System.out.println("l="+l);
System.out.println("f="+f);
System.out.println("i="+(long)i);
System.out.println("l="+(int)l);
System.out.println("f="+(int)f);
}
}
3....
public class Experiment2_4
{public static void main(String args[ ])
{___________; //声明一个整型变量i,并赋值为33333.
System.out.println("i="+i); //直接输出整型数i
System.out.println("i="+__); //输出i为长整型
_____________________; //输出i为单精度型
_____________________; //输出i为双精度型
_____________________; //输出i为字符型
有高手的帮帮我,万分感谢啊 展开
展开全部
1
public class Experiment2_2 {
public static void main(String args[]) {
// float f = 3.14159;//error
float f = 3.14159F;//error
double d = 123456789.123456789;
double e = -1.23456789e4;
System.out.println("f=" + f);
System.out.println("d=" + d);
System.out.println("e=" + e);
// System.out.println("f=" + (___) f);
// System.out.println("d=" + (___) d);
// System.out.println("e=" + (___) e);
// System.out.println("f=" + (___) f);
// System.out.println("d=" + (___) d);
// System.out.println("e=" + (___) e);
System.out.println("f=" + f);
System.out.println("d=" + d);
System.out.println("e=" + e);
System.out.println("f=" + f);
System.out.println("d=" + d);
System.out.println("e=" + e);
}
}
2
public class Experiment2_1 {
public static void main(String args[]) {
int i = 1234;
// long l = 12345678901234;
// float f = 3.14159;
long l = 12345678901234L;
float f = 3.14159F;
System.out.println("i=" + i);
System.out.println("l=" + l);
System.out.println("f=" + f);
System.out.println("i=" + (long) i);
System.out.println("l=" + (int) l);
System.out.println("f=" + (int) f);
}
}
3
public class Experiment2_4{
public static void main(String[] args) {
int i = 33333;//声明一个整型变量i,并赋值为33333.
System.out.println("i = " + i);//直接输出整型数i
System.out.println("i = " + (long)i); //输出i为长整型
System.out.println("i = " + (float)i);//输出i为单精度型
System.out.println("i = " + (double)i); //输出i为双精度型
System.out.println("i = " + (char)i);//输出i为字符型
}
}
public class Experiment2_2 {
public static void main(String args[]) {
// float f = 3.14159;//error
float f = 3.14159F;//error
double d = 123456789.123456789;
double e = -1.23456789e4;
System.out.println("f=" + f);
System.out.println("d=" + d);
System.out.println("e=" + e);
// System.out.println("f=" + (___) f);
// System.out.println("d=" + (___) d);
// System.out.println("e=" + (___) e);
// System.out.println("f=" + (___) f);
// System.out.println("d=" + (___) d);
// System.out.println("e=" + (___) e);
System.out.println("f=" + f);
System.out.println("d=" + d);
System.out.println("e=" + e);
System.out.println("f=" + f);
System.out.println("d=" + d);
System.out.println("e=" + e);
}
}
2
public class Experiment2_1 {
public static void main(String args[]) {
int i = 1234;
// long l = 12345678901234;
// float f = 3.14159;
long l = 12345678901234L;
float f = 3.14159F;
System.out.println("i=" + i);
System.out.println("l=" + l);
System.out.println("f=" + f);
System.out.println("i=" + (long) i);
System.out.println("l=" + (int) l);
System.out.println("f=" + (int) f);
}
}
3
public class Experiment2_4{
public static void main(String[] args) {
int i = 33333;//声明一个整型变量i,并赋值为33333.
System.out.println("i = " + i);//直接输出整型数i
System.out.println("i = " + (long)i); //输出i为长整型
System.out.println("i = " + (float)i);//输出i为单精度型
System.out.println("i = " + (double)i); //输出i为双精度型
System.out.println("i = " + (char)i);//输出i为字符型
}
}
展开全部
1、float f=3.14159;要写成float f=3.14159f;
double e=-1.23456789e4; 数值中的e怎么会出现这种呢? 去掉 不要写字母这些在里面
2、 float f=3.14159;要写成float f=3.14159f;
long l=12345678901234;要写成 long l=12345678901234l;
3、填空依次是:int i = 33333;
(long)i;
System.out.println("i为单精度"+(float)i);
System.out.println("i为双精度"+(double)i);
System.out.println("i为字符型"+(i+""));
或者 System.out.println("i为字符型"+Integer.toString(i));
double e=-1.23456789e4; 数值中的e怎么会出现这种呢? 去掉 不要写字母这些在里面
2、 float f=3.14159;要写成float f=3.14159f;
long l=12345678901234;要写成 long l=12345678901234l;
3、填空依次是:int i = 33333;
(long)i;
System.out.println("i为单精度"+(float)i);
System.out.println("i为双精度"+(double)i);
System.out.println("i为字符型"+(i+""));
或者 System.out.println("i为字符型"+Integer.toString(i));
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
float f=3.14159f
3
public class Experiment2_4{
public static void main(String[] args) {
int i = 33333;//声明一个整型变量i,并赋值为33333.
System.out.println("i = " + i);//直接输出整型数i
System.out.println("i = " + (long)i); //输出i为长整型
System.out.println("i = " + (float)i);//输出i为单精度型
System.out.println("i = " + (double)i); //输出i为双精度型
System.out.println("i = " + (char)i);//输出i为字符型
}
}
3
public class Experiment2_4{
public static void main(String[] args) {
int i = 33333;//声明一个整型变量i,并赋值为33333.
System.out.println("i = " + i);//直接输出整型数i
System.out.println("i = " + (long)i); //输出i为长整型
System.out.println("i = " + (float)i);//输出i为单精度型
System.out.println("i = " + (double)i); //输出i为双精度型
System.out.println("i = " + (char)i);//输出i为字符型
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你定义变量的时候出错啦 float f=3.14159f;记得加f long l=12345678901234l;记得加l ,所有的都改
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
float f=3.14159f;
1,2都是这个问题
1,2都是这个问题
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询