Java Question 2

2007-07-21 8:47 am
Write a calling method for folowing method:
a)public static String reverse (String str)
String rev = reverse(input); / String input = reverse ();
b)public static int truncate (double num) (aVar is int and bVar is double)
c)public static void display (STring value) (message is String)
d)public static float convert(String value) (aVar is float and bVar is String)

回答 (1)

2007-07-22 12:41 pm
✔ 最佳答案
a) seems like u have the answer already...String input = reverse(); is not valid unless u have another method declaration public static String reverse() which takes no arguments

b) aVar = truncate(bVar);

c) display(message);

d) aVar = convert(bVar);

These are the calling methods (method invocations)...if u r asking for method implemenations...then its something else...hope this helps


收錄日期: 2021-04-23 17:07:37
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20070721000051KK00192

檢視 Wayback Machine 備份