Problem Record (Iv.)

Source: Internet
Author: User
Tags arithmetic implement
Question 61. Q: Book Mybook=new book (BookID); The book is a servlet, an error.
For:
Book is a servlet, can book Mybook=new book (BookID);
Stating that you implemented the servlet container? Otherwise, the servlet can let you call it yourself?
Servlet if the call actually doesn't differ from EJB 1%, they both inherit or implement interfaces that implement a method of "dealing with" in these parent classes or interfaces, and then the container invokes these methods to manage it, allowing it to generate instances, pooling, passivation, destroying, Regeneration and so on. So it's wrong to write.

62. Q: Given a string 5* (5+9)/7 How to calculate the result?
For:
There are two ways to
1. Complete with stack
2. The simplest method, without programming, if there is any one of the database,
With select (5* (5+9)/7) from onetable

63. How do I implement encryption and decryption of the content of the form submitted?
For:
If you use IE currently can only use the SSL protocol, this layer do not you consider, or only you use your own tools to encrypt the transmission, after receiving and decryption friends, as to how to add the solution, if you want to combine with the recognized system, with the common Md5,ras, such as public algorithms, if you just preach their own solution, You can simply add something to your idea and get it back to lose it by the rules, and I'm sure no one else knows how to decrypt it except yourself.

64. Q: Why Integer.parseint ("+1"), throw numberformatexception exceptions?
A: Because the "+" Run is overloaded in Java. The system cannot determine whether you are using arithmetic plus or character +.

This can be better understood in javascript:
<form name= "T" ><input name=s value=1234></form>

var a = document.t.s.value+1;
At this point a = 12345, because Document.t.s.value as a string.
but var a = document.t.s.value-1;
A is 1233, because the system knows-the operation must be arithmetic. So put Document.t.s.value
Converted to numbers.


65. Q: Hashcode () Why is it sometimes necessary to overwrite the Hashcode () method in object?
A: This is the identity card of this object, or how to distinguish which object.

66. Q: How to implement a timed execution in Tomcat?
For:
Run automatically when the application starts. The servletlistener is defined in servlet2.3, listens to the servlet context start or closes (can be configured in a configuration file), and triggers the run of a daemon at startup ( can be implemented Java.util.Timer or Javax.swing.Timer).

67. Q: Can the program output itself?
A: The paradox of the hole is a very famous rule. It means that no program can export itself.

68. Q: Can I convert a character to an ASCII code? Like converting A to 65?
For:
int a= ' a ';
Out.println (a);

69. Q: How do you distinguish between Full-width and half-width in the input text?
A: Because the value of full-width and half-width characters cannot be distinguished, it is necessary to raise the whole-angle symbol.

70. Q: What do you do when you sign up for an automatic sender?
For:
This type of sender does not consider performance, because it is impossible to 1 seconds to have a person registered, we say the consideration of performance of the letter of the program is to refer to millions of letters in the queue to keep sending the kind, like you this casually how to write a program are OK, There is no need to use JavaMail. Just specify a server to send a letter and then use Cocket to connect its 25.
I use the socket even SMTP 25 to send a letter as if two neighbors send a thing, directly pass over, with JavaMail, message mechanism is that you send this thing from the post office to your neighbor.

Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.