Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
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));



}



}










Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 12:12 PM.


no new posts