Login to Website

Login dengan Facebook

 

Post Reply
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default [HELP] Mohon Penjelasannya gan

Gan, boleh minta bantuannya ga? ane dikasih tugas sama dosen ane, tp ane ga ngerti kerjain nya, ane mohon penjelasan dr agan" yang ngerti Java biar ane bisa kerjain nih tugas



Thx before



Begini gan soalnya:




Quote:





1. (using the Math.sqrt method) write a program that printa the following table using the sqrt method in the Math class.



Number squareRoot



0 0.0000



2 1.4142



�..



18 4.2426



20 4.4721







2. Suppose that s1 and s2 are two strings. Which of the following statements or expressions are incorrect?







String s = new String(�new string �);



String s3 = s1 + s2;



String s3 = s1 � s2;



s1 == s2;



s1 >= s2;



s1.compareTo(s2);



int i = sl.length();



char c = sl(0);



char c = sl.charAt(sl.length());







3. Describe primitive-type wrapper classes. Why do you need these wrapper classes?



4. What is wrong in the following code?





public class Test {



public static void main(String[] args) {



Number x = new integer(3);



System.out.println(x.intValue());



System.out.println((integer)x.compareTo(new Integer(4)));



}



}





5. What is output of the following code?







public class Test {



public static void main(String[] args) {







System.out.println(integer.parseInt(�10�));



System.out.println((integer.parseInt(�10�,10));



System.out.println((integer.parseInt(�10�,16));



}



}










Sponsored Links
Space available
Post Reply




Switch to Mobile Mode

no new posts