Soft JAVA pen questions, soft java questions
1. What method of MyObject will affect the correctness of the if expressionList l = new vertex List ();L. add (new MyObject (""));If (l. contains (new MyObject (""))){}A. toString ()B. equals ()C. hashCode ()D. clone ()-------------------------------- B2. What method of MyObject will affect the correctness of the if expressionSet ts = new TreeSet ();Ts. add (new MyObject (""));If (ts. contains (new MyObject
to the Promise object, so the error can be thrown normally, so the answer here should be to print "OK" first. Then throws the error defined in the process.The third uses both throw and timer to throw an error. Should it be the same as the second one? That's the wrong thing to think. When a throw is executed, although the error is not handled by an external function capture, this is a real error, and for JavaScript, there is no further execution. So it does not execute until the timer throws an
The essence of Struts2 technical insider reader's pen record frameworkThis book is mainly used by Lu Zhou.
> Book. Unless otherwise stated, the pictures used in the notes are taken from the books.
What is a framework? Why should we use the framework? What does the framework bring to us?
These problems are simple and complex. It is simple because the framework exists in the software design. It is complicated because the framework we are usin
Enter a string of numbers separated by spaces, sorted in ascending order for the odd digits of the number string, and the even digits in descending order.Example input:4 6 2 3 6 7 8 1Processing process:Odd digits: 4 2 6 8 Ascending sort Result: 2 4 6 8Even digits: 6 3 7 1 Descending sort Result: 7 6 3 1Result output: 2 7 4 6 6 3 8 1DemoImport java.util.*;public class Main {public static void Main (String args[]) {Scanner scan = new Scanner (system.in);String inStr = Scan.nextline ();Scan.close (
Several php pen questions from night travelers. I. Basic question 1. write the output result of the following program and copy the code as follows :? $ Str1null; $ str2false; echo $ str1 $ str2? Equal: not equal; $ str3; $ str40; ec
I. basic questions
1. write the output results of the following program
The code is as follows:
$ Str1 = null;$ Str2 = false;Echo $ str1 = $ str2? 'Equality ': 'Unequal ';$ Str3 = '';$ Str4 = 0;Echo $ str3 = $ str4?
This article from: http://www.cnblogs.com/kejie/p/5971773.htmlPublic dictionary{ Converts a string into an array of characters. Char[] Chararray=str. ToCharArray (); Defines a dictionary with key keys as the number of characters to be taken out, and value as the corresponding character. Dictionaryfor (int i=0;i If the current dictionary does not have this character, add a new one, or increment the corresponding value of the current character by one. if (!dic. ContainsKey (Charar
name and only returns the name.Problem Solving Ideas:1, the firewall is open.2. The Hosts file is changed.3. Whether "independent" or combined domainStandalone: Note the multiple option settings need to be changed: SOA, FQDN.Service notes:#ipconfig/flushdnsDNS buffering can be refreshed#netsh Interface IPv4 Show addressYou can view the network in a more concise way#netsh Firewall Set Opmode disableNote: Only firewalls that have public networks turned offabout other:The full TTL value is "Time t
The answer to a Baidu pen question-general Linux technology-Linux programming and kernel information. The following is a detailed description. Implement a function and calculate the minimum number of operations required by 1 for a positive integer n:
If n is an even number, set it to 2;
If n is an odd number, you can add or subtract 1;
Keep processing.
Example:
Ret = func (7 );
Ret = 4, it can be proved that at least 4 operations are required
N
I went to interview a foreign company today and met a pen question.
The general content of the question is as follows:
All the characters except "@" and "." In the mailbox are letters. Do not use regular expressions to write out ideas or draw flowcharts.
The following code is compiled by me:
String email = "hongtenfoxmail.com.cn" isEmail = String result = isEmail? "Correct": "Incorrect" System. out. println ("email [" + email + "] format:" + indexFlag
Test the Pen in C #. NEt-GDI +
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;//1366*768namespace PaintTest1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) {
The topic is as follows, to output the result classA { Public: A () {cout"A"Endl; } ~a () {cout"~a"Endl; } }; classB: PublicA { Public: B (Aa): _a (a) {cout"B"Endl; } ~B () {cout"~b"Endl; } Private: A _a; }; intMainvoid) {A A; b b (a); return 0; } Here's the answer first:[root]$./classAAB~B~a~a~aYou might find it strange, why not tune the constructor of a a once. In fact, this is due to the use of the initialization list, the initialization lis
maintained in this internal table for the self-incrementing primary key), and then each time the data is inserted, the maximum value is read and the increment is used as the primary key for the new record. This new maximum value is then updated back to the internal table so that an insert operation can cause multiple table reads and writes inside the database, along with the locking unlock operation of the data, which has a significant impact on performance. Therefore, it is recommended to use
[, thisArg])Each element of an array, called the definition of a callback function, returns a list containing the resultParameters:Array1: Must. An Array objectCALLBACKFN: Must. A callback function that accepts up to three parameters (the value of the array element, the index of the array element, the array object containing the element)Thisarg: Optional.The original example is equivalent to[Parseint ("1", 0), parseint ("2", 1), parseint ("3", 2)]Analysis:1 by decimal conversion Output 11 is not
1. What is the binary representation of the decimal value 1.5625? 1.10012. In binary data, the decimal point shifts one bit to the right, then the data: multiply by 2Parsing: (1) binary conversion to decimal: 1101.0101=2^3+2^2+2^0+2^-2+2^-4=13.3125;(2) Decimal decimal to binary: 0.3125*2=0.625, the first digit after the decimal point is 0;0.625*2=1.3, the second digit after the decimal point is 1;0.3*2=0.7, the third place after the decimal point is 0;0.7*2=1.4, the fourth digit after the decima
){intHL, HR, Max;if(BT = NULL) {HL = posttreedepth (bt->lchild);//find the depth of the left subtreehr = Posttreedepth (bt->rchild);//to find the depth of the right sub-treemax = HL > hr? HL:HR; //get the left and right subtree depth of the larger personreturn(Max +1);//returns the depth of the tree}Elsereturn(0);//if it is an empty tree, it returns 0}voidMain (){Bittree T;intHintLayerintTreeleaf; Layer =0;printf"Please enter the elements in the binary tree (in order to extend the sequential tra
Seventh chapter mapping and aggregation capabilitiesA dictionary (the only mapping type in Python)1 basicCreate and assign values:Normal creation: >>>dict = {' name ': ' Earth ', ' Port ': 80}Use the Factory function Dict () to create:>>> fdict = Dict ([' X ', 1], [' Y ', 2])>>> fdict{' Y ': 2, ' X ': 1}Use Fromkeys () to create a default dictionary:>>> ddict = {}.fromkeys (' x ', ' Y '),-1)>>> ddict{' Y ':-1, ' X ':-1}>>> edict = {}.fromkeys (' foo ', ' Bar ')>>> Edict{' Foo ': None, ' Bar ': n
][11, 9, 9, 9, 23, 9, 7, 11]>>> [(x+1,y+1) for x in range (3) for Y in range (5)][(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 1), (2, 2), (2,3), (2, 4), (2, 5), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5)]Viii. Generator ExpressionA builder expression is an extension of list resolutionBasic syntax:(Expr for Iter_var in iterable if cond_expr)Practical Examples:>>>x_product_pairs = ((i, j) for I in rows for J in Cols ())>>>type (X_product_pairs)>>>for I in X_product_pairs:... print I...(0,0)(0,1).
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.