public class VarMaxValue {
public static void main(String[]args){
//
byte largestByte=Byte.MAX_VALUE;
byte smallestByte=Byte.MIN_VALUE;
short largestShort=Short.MAX_VALUE;
short smallestShort=Short.MIN_VALUE;
int largestInteger=Integer.MAX_VALUE;
int smallestInteger=Integer.MIN_VALUE;
long largestLong=Long.MAX_VALUE;
long smallestLong=Long.MIN_VALUE;
//
float largestFloat=Float.MAX_VALUE;
float smallestFloat=Float.MIN_NORMAL;
double largestDouble=Double.MAX_VALUE;
double smallestDouble=Double.MIN_NORMAL;
//
char aChar='S';
//
boolean aBoolean=true;
System.out.println("byte型变量最大、最小值="+largestByte+", "+smallestByte);
System.out.println("short型变量最大、最小值="+largestShort+", "+smallestShort);
System.out.println("integer型变量最大取值="+largestInteger);
System.out.println("integer型变量最小取值="+smallestInteger);
System.out.println("long型变量最大取值="+largestLong);
System.out.println("long型变量最小取值="+smallestLong);
System.out.println("flort型变量最大值="+largestFloat);
System.out.println("flort型变量最小值="+smallestFloat);
System.out.println("double型变量最大值="+largestDouble);
System.out.println("double型变量最小值="+smallestDouble);
System.out.println("字符aChar的值="+aChar);
System.out.println("布尔变量aBoolean="+aBoolean);
}
}
public class Assogn {
public static void main(String args []){
int x;
float y=3.414f;
double z=3.1415;
boolean truth=false;
char c='A';
String str1="bye";
x=6;
System.out.println("整数型变量x="+x);
System.out.println("浮点型变量y="+y);
System.out.println("双精度型变量z="+z);
System.out.println("字符串型变量str1="+str1);
System.out.println("字符型变量c="+c);
System.out.println("布尔型变量truth="+truth);
}
}
public class DoWhileTest {
public static void main(String args []){
String sourceStr="Copy this string until you encAounter'g'.";
StringBuffer destStr=new StringBuffer();
int i=0;
char c=sourceStr.charAt(i);
do{
destStr.append(c);
c=sourceStr.charAt(++i);
}
while(c!='A');
System.out.println(destStr);
System.out.println(sourceStr);
}
}