To achieve the purpose of putting all the files under the development directory, print them out in a tree-like structure. The code is as follows:Package Cn.bjsxt.io;Import Java.io.File;public class Filetree {public static void Main (string[] args) {File F=new file ("e:/useful Document"); Suppose you print all the files in this directoryPrinttree (f, 0); Starting from itself, from 0 }public static void Print
-begain) >= (30*1000)) {//judging time to 30 secondsSystem.out.println ("End after 30 seconds"); Break; } } }After simplifying the code: Public Static voidMain (string[] args) {LongBegain = System.currenttimemillis ();//Start System Time LongChecktime = System.currenttimemillis ();//Judging Time while(true){ //Write the program you want to run here!!!!!Checktime = System.currenttimemillis ();if((Checktime-begain) >= (30*1000)) {//judging time to 30 secondsSystem.out.println
Original: Java print Yang Hui triangleSource code: Http://www.zuidaima.com/share/1550463522032640.htmJava Print Yang Hui trianglePackage com.zuidaima.util;public static void Main (string[] args) { int i, j, n = 8, L, R; int a[] = new int[9]; SYSTEM.OUT.PRINTLN (1); for (i = 1; I After running:Java Print
/** * Print Yang Hui triangle function Description: Print 6-step Yang Hui triangle with multiple loops * @author Administrator * */public class Sz_7 {public static void main (string[] args) {Scanner in = new Scanner (system.in); System.out.println ("Please enter line number:"); int m = In.nextint (); int n = 2*m-1;//column element; int arr[][] = new Int[m][n];for (int i = 0; i
Definition of the Fibonacci sequence (Fibonacci sequence) : The Fibonacci sequence refers to such a sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233,377,610,987,1 597,2584,4181,6765,10946,17711,28657,46368 ..., this series begins with the 3rd item, each of which equals the sum of the first two.
The Fibonacci sequence, also known as the Golden Section sequence, was introduced by the mathematician Leonardo's Fibonacci (Leonardoda Fibonacci) as an example of rabbit breeding, which is called
[Original reprint annotated Source]Title 3: Print out 100-999 of all narcissus numbers.Ideas:Narcissus number refers to an n-digit number (n≥3), and the sum of the number of its digits on each bit is equal to its own.(Example: 1^3 + 5^3+ 3^3 = 153)Java Code Implementation1 PackageJichu;2 3 Public classJICHU34 {5 Public Static voidMain (string[] args)6 {7 intB, S, G;8 for(inti = 1
This is a childhood back of the 99 multiplication table, is the Chinese version, not the digital version, with the Java program printed out.The Java source program is as follows:Package Com.elephant.multiply99table;public class Multiply99table {public static String Convert (int digit) {string[] Digitwords = {"Ten", "One", "two", "three", "four", "five", "six", "seven", "eight", "Nine"};if (Digit The result
Package test; import Java. io. bufferedreader; import Java. io. inputstreamreader; /*** @ author javaalpha * @ date 2011-12-14 * @ Version V 1.0 Java calls ipconfig to print the NIC information and MAC address of the Local Machine */public class readmac {public static string physicaladdress = "read mac error! "; Public
This is a child back of the 99 multiplication table, is the Chinese version, not a digital version, with a Java program to print out.The Java source program is as follows:
Package com.elephant.multiply99table;
public class Multiply99table {public
static String Convert (int digit) {
string[] digitwords = {"Ten", "One", "two", "three "," Four "," five ",
Previously developed Kjava game, did not develop how long, and then turn to Android, contact with Android are aware that Android has log print log, recently due to job needs, not print log ...
Although before there are some information to print, System.out.println (); Discovery is a bit of use, but when you program big, did not add some other data is very trouble
Recently in the development needs a function, to the third-party server to send our data, the package format requirements of the data is particularly strict, after the completion of the assembly data, sent to the third party server but how can not pass, looked for a long time, also compared to the other side of the data samples, or not, Later check the code and intercept the sent data only found that when the socket is sent, using the println () method, this method will automatically add a carri
Code: PackageCom.test.demos; Public classDiamond {/*** Test Main method*/ Public Static voidMain (string[] args) {Printdiamond (10);//10 for diagonal length } /*** Print Diamond Implementation Method*/ Public Static voidPrintdiamond (intsize) {Size= (SIZE/2) * 2;//The width on both sides of the diamond diagonal is the same, so the diagonal length size must be even, (size+1) is the number of rows and columns intCenter = (SIZE/2);//
Print binary heap: Using Hierarchical relationshipsI am here to sort the heap first and then execute the print heap in sort printastree ()public class MaxheapExecution Result:Print binary heap (Java implementation)
Title Description:Enter a list to print the values of each node of the list from the end of the head.Code implementation:/*** public class ListNode {* int val;* listnode next = null;** listnode (int val) {* t His.val = val;*}*}**/Importjava.util.ArrayList;ImportJava.util.Stack; Public classSolution { PublicArraylistPrintlistfromtailtohead (ListNode listnode) {StackNewStack(); ArrayListNewArraylist(); while(listnode!=NULL) {Stack.push (listnode.val);
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.