1. abstract class AbstractIt { 2. abstract float getFloat(); 3. } 4. public class AbstractTest extends AbstractIt { 5. private float f1 = 1.0f; 6. private float getFloat() { return f1; } 7. }
Show comments for this question (0) Add comments Link to this question
11. for( int i = min; i <max; i++) { 12. System.out.println(i); 13. }
11. double d = Math.random();
1. public class Alpha{ 2. private static Character() ids; 3. 4. public static void main( String[] args){ 4. ids = new Character[args.length]; 5. for (int i=0; i<ids.length; i++){ 6. ids[i] = new Character( args[i] ); 7. System.out.print( ids[i] ); 8. } 9. } 10. }
Show comments for this question (1) Add comments Link to this question
1. public class Alpha{ 2. public static void main( string[] args ){ 3. if ( args.length == 2 ) { 4. if ( args.[0].equalsIgnoreCase(“-b”) ) 5. System.out.println( new Boolean( args[1] )); 6. } 7. } 8. }
11. int i = 0, j = 1; 12. if ((i++ == 1) && (j++ == 2)) { 13. i = 42; 14 } 15. System.out.println(“i = “ + i + “, j = “ + j);
1. public class X ( 2. private static int a; 3. public static void main(String [] args) { 4. modify(a); 5. System.out.println(a); 6. } 7. public static void modify(int a) { 8. a++; 9. } 10 }
1. public class Test { 2. public static void add3 (Integer i) { 3. int val = i.intValue(); 4. val += 3; 5. i = new Integer(val); 6. } 7. 8. public static void main(String args[]) { 9. Integer i = new Integer(0); 10. add3(i); 11. System.out.println(i.intValue()); 12 } 13 }