[Java programming ideas, java programming ideas

Source: Internet
Author: User

[Java programming ideas, java programming ideas
Thinking in Java


The code I typed in this program is very stupid. I will try it. I don't have time to think so much, so I have to continue learning.

1 class Vnum {2 public static void main (String args []) {3 CheckVampire cVampire = new CheckVampire (); 4 for (int I = 1000; I <10000; I ++) {5 if (cVampire. isVampire (I) {6 System. out. println (I); 7} 8} 9} 10 11 static class CheckVampire {12 // split num into each and save 13 void EveryBit (int num, int numArr []) {14 if (1000> num) | (10000 <num )) {15 numArr [0] = numArr [1] = numArr [2] = numArr [3] = 0; 16 return; 17} else if (num % 1 00 = 0) {18 numArr [0] = numArr [1] = numArr [2] = numArr [3] = 0; 19 return; 20} else {21 numArr [3] = num/1000; 22 numArr [2] = num % 1000/100; 23 numArr [1] = num % 100/10; 24 numArr [0] = num % 10; 25} 26} 27 // enter a num. If the returned value is true, the num is the vampire number 28. // The detection result is 1000 ~ If the number of the vampire is less than 9999, the method of exhaustion = should be used. There should be a better way on the Internet to 29 boolean isVampire (int num) {30 int numEveryBit [] = new int [4]; 31 EveryBit (num, numEveryBit); 32 if (num = (numEveryBit [0] * 10 + numEveryBit [1]) * (numEveryBit [2] * 10 + numEveryBit [3]) {33 return true; 34} 35 else if (num = (numEveryBit [0] * 10 + numEveryBit [1]) * (numEveryBit [3] * 10 + numEveryBit [2]) {36 return true; 37} 38 else if (num = (numEveryBit [1] * 10 + numEveryBit [0]) * (numEveryBit [2] * 10 + numEveryBit [3]) {39 return true; 40} 41 else if (num = (numEveryBit [1] * 10 + numEveryBit [0]) * (numEveryBit [3] * 10 + numEveryBit [2]) {42 return true; 43} 44 45 else if (num = (numEveryBit [0] * 10 + numEveryBit [2]) * (numEveryBit [1] * 10 + numEveryBit [3]) {46 return true; 47} 48 else if (num = (numEveryBit [0] * 10 + numEveryBit [2]) * (numEveryBit [3] * 10 + numEveryBit [1]) {49 return true; 50} 51 else if (num = (numEveryBit [2] * 10 + numEveryBit [0]) * (numEveryBit [1] * 10 + numEveryBit [3]) {52 return true; 53} 54 else if (num = (numEveryBit [2] * 10 + numEveryBit [0]) * (numEveryBit [3] * 10 + numEveryBit [1]) {55 return true; 56} 57 58 else if (num = (numEveryBit [0] * 10 + numEveryBit [3]) * (numEveryBit [1] * 10 + numEveryBit [2]) {59 return true; 60} 61 else if (num = (numEveryBit [0] * 10 + numEveryBit [3]) * (numEveryBit [2] * 10 + numEveryBit [1]) {62 return true; 63} 64 else if (num = (numEveryBit [3] * 10 + numEveryBit [0]) * (numEveryBit [1] * 10 + numEveryBit [2]) {65 return true; 66} 67 else if (num = (numEveryBit [3] * 10 + numEveryBit [0]) * (numEveryBit [2] * 10 + numEveryBit [1]) {68 return true; 69} 70 else {71 return false; 72} 73} 74} 75}

 


A book on java programming ideas is recommended.

Hmm
This book
<JAVA Object-Oriented Programming>
I think it's good.
Highlight useful key points, and do not write anything that is useless

Then, if you want to attack the thread
This book
<JAVA concurrent programming practices>
I am now reading a book named Chao Niu. I have a lot of books.
Highly recommended
PS: I'm talking about it. It's not a quick browsing. Remember, you can read more books and never think that you can read more books :)

---------------------------------

You can read this book on JAVA Object-Oriented Programming Based on JAVA programming ideas.
This gives you a better understanding of the JAVA operating mechanism.
--------------------------------

Yes. This is the Book. Of course. It cannot be limited to this book. You should read other books while reading this book so that your vision can be expanded.
Reference books <JAVA programming ideology> <Core java Core programming> Vol. 1, 2
Of course, these reference books are based on that book and then focus on it :)
If you see related content in programming ideology, such as internal content, you 'd better take some of the above examples and understand it. in this way, we can truly understand. because it is written by a programmer who has a profound understanding of JAVA, it is sometimes difficult to understand.
To sum up one sentence, you can read and practice JAVA.
Good luck at last

How to Understand java programming ideas?

My personal understanding:
Java programming ideas are not a book suitable for beginners. At least I should read this book after having a certain understanding of object-oriented programming. I also read this book intermittently, now I have read more than half of the books, and some of them are not fully understood. I think it is impossible to understand a good book once, and I cannot fully understand it once, if you have time, read it over and over again. As your programming experience increases, your understanding will become deeper and deeper.

If you do not have any foundation, we recommend that you first learn the C language and master the variables, functions, if, else, And for loops. These things are shared by all programming languages.

I don't know if you have enough time. If you want to learn java, you should first learn the basics (j2se). If you want to learn j2ee later, you should learn java web after learning the basics, including html and javascript, after learning about css, servlet, and jsp, I began to learn some frameworks, such as struts, spring, and hibernate. There are a lot of things to learn. If it is self-taught, I guess it will take at least one year. So if you want to learn java, you must be prepared and keep learning!

I hope the above will help you!

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.