问题1:
public class Literals
{
public static void main(String[] args)
{
char c = 0xffff;
System.out.println("c is: " + c);
byte b = 0x7f;
System.out.println("b is: " + b);
int i1 = 0x2f;
System.out.println("i1 is: " + i1);
int i2 = 0X2F;
System.out.println("i2 is: " + i2);
int i3 = 0177;
System.out.println("i3 is: " + i3);
float f1 = 1e-45f;
System.out.println("f1 is: " + f1);
float f2 = 1e+9f;
System.out.println("f2 is: " + f2);
double d = 47e47d;
System.out.println("d is: " + d);
}
}
结果:
c is: ?
b is: 127
i1 is: 47
i2 is: 47
i3 is: 127
f1 is: 1.4E-45
f2 is: 1.0E9
d is: 4.7E48
Press any key to continue...
f1 is: 1.4E-45
f2 is: 1.0E9
d is: 4.7E48
这三个是怎么出来的啊? 表示什么呢?看不懂哦~
问题2:
class Soap
{
private String s;
Soap()
{
System.out.println("Soap()");
s = new String("Constructed");
}
public String toString()
{
return s;
}
}
public class Bath
{
private String s1 = new String("Happy"), s2 = "Happy", s3, s4;
private Soap castille;
private int i;
private float toy;
public Bath()
{
System.out.println("Inside Bath()");
s3 = new String("Joy");
i = 47;
toy = 3.14f;
castille = new Soap();
}
public String toString()
{
if(s4 == null)
s4 = new String("Joy");
return "s1 = " + s1 + "\n" + "s2 = " + s2 + "\n" + "s3 = " + s3 + "\n" + "s4 = " + s4 + "\n" + "i = " + i + "\n" + "toy = " + toy + "\n" + "castille = " + castille;
}
public static void main(String[] args)
{
Bath b = new Bath();
System.out.println(b);
}
}
结果是:
Inside Bath()
Soap()
s1 = Happy
s2 = Happy
s3 = Joy
s4 = Joy
i = 47
toy = 3.14
castille = Constructed
Press any key to continue...
这一句System.out.println(b);不是应该打印b@地址么?怎么就直接调用toString了呢?而且是怎么打印出来的啊?它只是return而已啊?
问题3:
class Game
{
Game(int i)
{
System.out.println("Game constructor");
}
}
class BoardGame extends Game
{
BoardGame(int i)
{
super(i);
System.out.println("BoardGame constructor");
}
}
public class Chess extends BoardGame
{
Chess()
{
super(11);
//super.BoardGame(11);
System.out.println("Chess constructor");
}
public static void main(String[] args)
{
Chess x = new Chess();
}
}
//super.BoardGame(11);为什么这一行会报错呢?这样不行么?
问题4:
那个移位的操作好麻烦的说。。
就是>>,<<,>>>,<<<,以后编程真的用得到么??什么地方会用到啊?
问题5:
请问谁有jcreator 3。5。013的注册码? 偶还有25天就到期了!!!!
问题6:
请问java有那个编译器有VA_X这样的插件么?编c的时候用vc加这个习惯了,真是超级好的插件啊,java哪个编译器有么?
问题7:
偶有thinking in java 第三版的光盘,有人要么?怎么传来上?
里面是好多c++的程序,thinking in c++电子版,和作者15个小时的mp3讲课,e文,速度快,偶听得好晕。。。。