C # simple interview questions (5)

Source: Internet
Author: User

61. Does the array have the length () method? Does string have the length () method?

The array and string do not have the length () method, but only the Length attribute.

62. What is the difference between sleep () and wait?

The sleep () method suspends the current thread for the specified time. Wait () releases the lock on the object and blocks the current thread until it acquires the lock again.

63. The elements in the set cannot be repeated. How can we identify whether the elements are repeated or not? Is = or equals () used ()? What are their differences?

The elements in the set cannot be repeated, so the iterator () method is used to identify whether the elements are repeated or not. Equals () is used to determine whether two sets are equal. The equals () and = Methods Determine whether the reference value points to the same object equals () is overwritten in the class, in order to return the true value when the content and type of the two separated objects match.

64. Short S1 = 1; S1 = S1 + 1; what is the error? Short S1 = 1; S1 + = 1; what is the error?

Short S1 = 1; S1 = S1 + 1; error: S1 is short type, S1 + 1 is int type, cannot be converted to short type explicitly. It can be changed to S1 = (short) (S1 + 1 ). Short S1 = 1; S1 + = 1 is correct.

65. let's talk about the differences between final, finally, and finalize.

final-modifier (keyword) if a class is declared as final, it means that it cannot generate a new subclass and cannot be inherited as a parent class. Therefore, a class cannot be declared both abstract and final. Declare variables or methods as final to ensure that they are not changed during use. Variables declared as final must be declared with an initial value, which can only be read and cannot be modified in future references. Methods declared as final can only be used and cannot be overloaded. Finally-The Finally block is provided for troubleshooting. If an exception is thrown, the matched catch clause is executed, and the control enters the Finally block (if any ). Finalize-method name. Java technology allows the use of the finalize () method to perform necessary cleanup before the Garbage Collector clears the image from the memory. This method is called by the garbage collector when it determines that this object is not referenced. It is defined in the object class, so all classes inherit it. Subclass overwrites the finalize () method to sort system resources or perform other cleanup tasks. The finalize () method is called before the Garbage Collector deletes an object.

66. What is the difference between a process and a thread?

A process is the unit of resource allocation and scheduling by the system. A thread is the unit of CPU scheduling and scheduling. A process can have multiple threads which share the resources of the process.

67. How many stages are there in the software development process? What is the role of each stage?

Requirement Analysis, architecture design,CodeWriting, QA, and deployment

68. to process a string, remove the spaces at the beginning and end of the string. If there are consecutive spaces in the string, only one space is reserved, that is, multiple spaces are allowed in the string, however, the number of consecutive spaces cannot exceed one.String inputstr = "xx ";

Inputstr = RegEx. Replace (inputstr. Trim (), @ "\ s + ","");

69. what is XML?

XML to extend the markup language. Extensible Markup Language. A tag is an information symbol that a computer can understand. With this tag, computers can process articles that contain various information. To define these tags, you can select an international markup language, such as HTML, or use a markup language that is freely determined by people like XML. This is the scalability of the language. XML is simplified and modified from SGML. It mainly uses XML, XSL, and XPath.

What is the ternary operator in 70. C?

? :.

71. Which of the following types of Class Members are accessible?

This.; new class (). method;

72.Float F =-123.567f; int I = (INT) F; what is the I value now _____?

-123.

73. In. Net hosting code, we don't have to worry about memory vulnerabilities. This is because ______?

GC.

74 .. In. net, can system. Web. UI. Page be inherited?

Yes.

What is the error handling mechanism of 75.net?

The. NET error handling mechanism adopts the try-> catch-> finally structure. When an error occurs, it is thrown layer by layer until a matching catch is found.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.