Java Debugging Small example (how to use F5 and F6)

Source: Internet
Author: User

If a class has 3 methods, set a breakpoint in front of the 3 methods, a total of 3 breakpoints, and then enter Debug debugging,

Always press F6 (step over) he will go directly into the method and not need you to press F5 (step Into)

Or you just set a breakpoint in the first method, then you need to press F5 (Step into) to enter the method when debugging.

Package args parameter problem;/* * Study questions 1: Look at the program to write the results, and then analyze why it looks like this. and draw the explanation. Finally, we summarize the rules of parameter passing in Java. * Parameter passing problem in Java: Basic type: The change of formal parameters has no effect on the actual parameters. Reference type: Changes in formal parameters directly affect the actual parameters. */public  class Argsdemo {public static void main (string[] args) {int a = 10;int B = 20; System.out.println ("A:" +a+ ", B:" +b); A:10,b:20change (A, b); System.out.println ("A:" +a+ ", B:" +b); //??? A:10,b:20int[] arr = {1,2,3,4,5}; Change (arr); System.out.println (arr[1]); //??? 4}public static void change (int a,int b) {//a=10,b=20system.out.println ("A:" +a+ ", B:" +b); a:10,b:20a = b;//a=20b = a + b; B=40system.out.println ("A:" +a+ ", B:" +b); a:20,b:40}public static void Change (int[] arr) {//arr={1,2,3,4,5};for (int x=0; x<arr.length; x + +) {if (arr[x]%2==0) {arr[x]*=2;}} arr={1,4,3,8,5};}}



Java Debugging Small example (how to use F5 and F6)

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.