121, can the internal class can reference him members of the class? Is there any restriction? An internal class object can access the content 122 of the external class object that creates it, the web service noun explanates. JSWDL development package. JAXP, JAXM explanation. SOAP, UDDI, WSDL Explanation. Web ServiceWeb Service is a network-based, distributed modular component, which performs specific tasks, complies with specific technical specifications, which make Web Service interoperate with other compatible components. JAXP (Java API for XML PARSING) Defines the universal interface using DOM, SAX, XSLT in Java. This way in your program you only need to use these universal interfaces, and do not need to modify the code when you need to change the specific implementation. JAXM (Java API for XML Messaging is an API that provides access methods and transport mechanics for SOAP communication. WSDL is an XML format for describing network services as a set of endpoints that operate on messages that contain document information or process information. This format first abstracts the operation and message, then binds it to the specific network protocol and message format to define endpoints. The relevant specific endpoints are combined into an abstract endpoint (service). SOAP is a Simple Object Access Protocol, which is a lightweight protocol used to exchange XML encoded information. The purpose of UDDI is to establish standards for e-commerce; UDDI is a web-based, distributed, implementation standard specification provided by the information registry for Web Service, and also includes a group of web services that can provide themselves. Register to achieve the implementation of the access protocols that other companies can discover.
Java code check error 1.Abstract class name {private string name; public abstract boolean isstupidName (String name) {}} heroes, what is wrong? Answer: wrong. Abstract Method must end with a semicolon and do not bring a curly bracket. 2.PUBLIC CLASS Something {Void Dosomething () {private string s = ""; int L = s.Length ();}} Is it wrong? Answer: wrong. Any access modifier (private, PUBLIC, and Protected) cannot be placed before the local variable. Final can be used to modify local variables (Final is like Abstract and Strictfp, all non-access modifiers, Strictfp can only modify Class and Method rather than variable). 3.Abstract Class Something {private abstract string dosomething ();} This seems to be nothing wrong? Answer: wrong. Abstract Methods cannot be modified in private. Abstract Methods is the specific details of the subclass item, how can I use Private to block AbstractMethod? (Simply, you can't add Final before Abstract Method). 4.public class something {public int address (femal int x) {return x;}} This is more obvious. Answer: wrong. INT X is modified to Final, meaning X cannot be modified in Addone Method. 5.public class something {public static void main (String [] args) {other o = new other (); new thing (); public void addone (Final Other O) {O.}; } Class Other {public Int i;} is very similar to the above, is about Final's problem, is this wrong? answer: Correct. In Addone Method, the parameter O is modified into final. If we modified O's Reference in Addone Method (for example: o = new other ();), then this question is also wrong. But this is modified here that the MEMBER VAIRABLE (member variable) of O, while the REFERENCE does not change. 6.Class Something {Int i; public void dosomething () {system.out.println ("i =" i);}} Is there anything wrong? Can't see it. Answer: Correct. The output is "i = 0". INT i belongs to Instant Variable (instance variable, or a member variable). Instant variable has default value. INT's default value is 0.7.class something {final int i; public void dosomething () {system.out.println ("i =" i);}}} and topical only one place is different, that is, more A final. Is this wrong? Answer: wrong.
Final INT i is a Final's Instant Variable (instance variable, or a member variable). Final Instant Variable No default value must be given a clear value before the constructor ends. Can be modified to "Final INT I = 0;". 8.public class something {public static void main (String [] args) {something s = new something (); system.out.println ("s.dosomething () returns" DOSMETHING ());} public string dosomething ) {Return "Do Something ...";}} It looks perfect. Answer: wrong. It seems that there is no problem in main dosomething in main, after all, two Methods are in the same class. But look carefully, main is static. Static Method can't directly call Non-Static Methods. It can be changed to "S.DOSMETHING () Returns" S.DOSomething ()); ". Similarly, Static Method cannot access Non-Static Instant Variable. 9. Here, the file name of the Something class is Otherthing.javaclass Something {Private Static void Main (String [] Something_to_do) {system.out.println ("Do Something ...");}} This seems to be obvious. Answer: Correct. No one has said that the Java's Class name must be the same as its file name. But the name of the public class must be the same as the file name. 10. Interface A {int x = 0;} class b {int x = 1;} Class C Extends b IMPLEments A {public void px () {system.out.println (x);} public static void main (String [] args ) {New c (). Px ();}} answer: error. Errors occur when compiling (Error Description Different JVMs have different information, means that the unclear X call, two X matches (just like IMPORT JAVA.UTIL and Java.sql two packages Date Date) The same). For the variable of the parent class, you can use Super.x to explicit, and the attribute of the interface is implied as public static final. So you can clear it through AX.
11.interface Playable {void play ();} interface Bounceable {void play ();} interface Rollable extends Playable, Bounceable {Ball ball = new Ball ( "PingPang");} class Ball implements Rollable {private String name; public String GetName () {return name;} public ball (String name) {this.name = name;} public void play () {ball = new ball ("football"); system.out.println (ball.getname ()) This error is not easy to find. Answer: wrong. "Interface Rollable Extends Play, Bounceable" is no problem. Interface can inherit multiple Interfaces, so it is right. The problem is in the Interface Rollable "Ball Ball = New Ball (" pingpang ");". Any Interface Variable (interface variable, or member variable) declared in Interface, the default is public static final. That is, "Ball Ball = New Ball (" pingpang ");" actually "public static final ball ball = new ball (" pingpang ");". In the Play () method of the Ball class, "football"); "Change the Ball Reference, and the Ball from Rollable Interface, the ball in the Rollable Interface is public static final, Final Object It is not possible to change Reference. Therefore, the compiler will be "Ball = New Ball (" football ");" it is wrong here.
Java program 1. Now enter N numbers, separately, separate; then select liter or descending order, press what order is displayed on another page, and the result is RESETIMPORT JAVA.UTIL. *; Public Class Bycomma {public static String [] splitstringBYCOMMA (String Source) {if (source == null || source.trim (). Equals (")) Return Null; StringTokenizer Commatoker = New StringTokenizer (Source,", "); String [] Result = New String [commatoker.counttokens ()]; int i = 0; while (commatoker.hasmoretoKens ()) {result [i] = commatoker.nextToken (); i ;} return result;} public static void main (String args [] ) {String [] s = splitstringBYCOMMA ("5, 8, 7, 4, 3, 9, 1"); int [] ii = new int [S.LENGTH]; for (int i = 0; i
package test.format; import java.text.NumberFormat; import java.util.HashMap; public class SimpleMoneyFormat {public static final String EMPTY = ""; public static final String ZERO = "zero"; public static final String ONE = "One "; Public static final string tW =" "; public static final string three =" 叁 "; public static final string four =" "; public static final string file =" Wu "; public static final string Six =" land "; Public static final string seven =" 柒 "; public static final string eight =" 捌 "; public static final string nine =" 玖 "; public static final string ten =" Pick up "; public static final string hundred =" 佰"; public static final String tHOUSAND =" thousand "; public static final String TEN_THOUSAND =" Wan "; public static final String HUNDRED_MILLION =" one hundred million "; public static final String yUAN =" meta "; public static final String JIAO =" angle "; Public static final string fen =" division "; public static final string dot =". "; Private static simplemoneyformat formatter = null; private hashmap ch INESENUMBERMAP = New hashmap (); private hashmap chinesemoneyPattern = new hashmap (); private numberformat Numberformat = Numberformat.getInstance ();
Private SimpleMoneyformat () {Numberformat.SetMaximumFracthenDigits (4); Numberformat.SetMinimumfractionDigits (2); NumberFormat.SetGroupingUsesed (false);
ChineseUmbermap.put ("0", zero); chinesenumbermap.put ("1", one); chinesenumbermap.put ("2", two); chinesenumbermap.put ("3", three); chinesenumbermap.put ("4 ", Four); chinesenumbermap.put (" 5 ", FIVE); chineseumbermap.put (" 6 ", six); chinesenumbermap.put (" 7 ", seven); chinesenumbermap.put (" 8 ", eight); chinesenumbermap .put ("9", nine); chinesenumbermap.put (dot, dot); ChineseMoneyPattern.put ("1", ten); chinesemoneyPattern.put ("2", hundred); chinesemoneyPattern.put ("3", Thousand CHINESEMONEYPATTERN.PUT ("4", Ten_thousand; ChineseMoneyPattern.put ("5", TEN); chinesemoneyPattern.put ("6", hundred); chinesemoneyPattern.put ("7", thousand); chinesemoneyPattern.put "8", hundred_million;
Public static simpleMoneyformat getInstance () {if (formatter == null) formatter = new SimpleMoneyFormat (); Return Formatter;
Public String Format (String MoneyStr); string result; result = convertTochineseNumber (MoneyStr); result = addunitstochineseMoneyString (result); Return Result;}
Public String Format (Double Moneydouble) {Return Format (NumberFormat (Moneydouble));
Public String Format (INT Moneyint) {Return Format (NumberFormat (Moneyint));
Public String Format (Long Money) {Return Format (Numberformat.Format (Money));
Public String Format (Number Moneynum) {Return Format (Numberformat.Format (MoneyNum));
private String convertToChineseNumber (String moneyStr) {String result; StringBuffer cMoneyStringBuffer = new StringBuffer (); for (int i = 0; i
String fractionPart = cMoneyStringBuffer.substring (cMoneyStringBuffer.indexOf () "."); CMoneyStringBuffer.delete (cMoneyStringBuffer.indexOf (), cMoneyStringBuffer.length () ".");! While (cMoneyStringBuffer.indexOf ( "zero-pick") = -1) {cmoneyStringBuffer.Replace (CmoneyStringBuffer.indexof ("Zero Pick"), cmoneyStringBuffer.indexof ("Zero Pick") 2, ZERO);} While (cmoneyStringBuffer.indexof ("Zero")! = -1) {cMoneyStringBuffer.replace (cMoneyStringBuffer.indexOf ( "zero Bai"), cMoneyStringBuffer.indexOf ( "zero Bai") 2, zERO);} (! cMoneyStringBuffer.indexOf ( "zero thousand") = -1) while {cMoneyStringBuffer. replace (cMoneyStringBuffer.indexOf ( "zero thousand"), cMoneyStringBuffer.indexOf ( "zero thousand") 2, zERO);} while (! cMoneyStringBuffer.indexOf ( "zero Wan") = -1) {cMoneyStringBuffer.replace (cMoneyStringBuffer .indexof ("万"), cmoneyStringBuffer.indexof ("万") 2, Ten_thousand);} while (cmoney ")! = -1) {cmoneyStringBuffer.Replace (cmoneyStringBuffer.indexof "亿"), cmoneyStringBuffer.indexo f ("零") 2, hundred_million;} while (cmoney "! = -1) {cmoneyStringBuffer.Replace (CmoneyStringBuffer.indexof (" zero zero), cmoneyStringBuffer.indexof (" dated ") 2, ZERO);} if (cMoneyStringBuffer.lastIndexOf (ZERO) == cMoneyStringBuffer.length () - 1) cMoneyStringBuffer.delete (cMoneyStringBuffer.length () - 1, cMoneyStringBuffer.length ()); cMoneyStringBuffer. Append (FRActionPART); Result = cmoneyStringBuffer.tostring (); returnrate;}