Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the idea code completion features?

Shulou Source: shulou.com Published: 2022-06-02 20:33:06 10月03日 Update

This article focuses on "what are the idea code completion features", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what are the idea code completion features"?

If correlation

Define a variable of type boolean flag and a variable of type String name for testing.

Boolean flag = true;String name = "Java Journey"

The judgment condition is established.

Syntax:

Flag.if

Effect:

If (flag) {}

The judgment condition is not valid.

Syntax:

Flag.else

Effect:

If (! flag) {}

The judgment condition is equal to null

Syntax:

String.null

Effect:

If (string = = null) {}

Judgment condition is not equal to null

Syntax:

String.notnull or string.nn

Effect:

If (string! = null) {}

Use switch to judge

Syntax:

Switch (string) {}

Effect:

Switch (string) {}

Use while to judge

Syntax:

Flag.while

Effect:

While (flag) {} for related

Define an array of string types to test.

String [] param = {"1", "2", "3"}

Traverse from the first element

Syntax:

Param.fori

Effect:

For (int I = 0; I

< param.length; i++) {} 从最后一个元素进行遍历 语法: param.forr 效果: for (int i = param.length - 1; i >

= 0; iMurt -) {}

Enhanced for cycle

Syntax:

Param.for or param.iter

Effect:

For (String s: param) {} variable correlation

Define a new User class and add two attributes, name and age, for testing.

Public class User {private String name = "Java journey"; private int age = 18; public User () {} public User (String name, int age) {this.name = name; this.age = age;}}

Create an object

Syntax:

User.new

Effect:

New User ()

Create a local variable

Syntax:

New User () var

Effect:

User user = new User ()

Create a global variable

Syntax:

New User () field

Effect:

Private User user;user = new User ()

Cast object types, if we convert Object to User

Syntax:

New object.castvar

Effect:

User user = (User) new Object (); other commonly used

Return statement

Syntax:

".return

Effect:

Return ""

Print statement

Syntax:

Flag.sout

Effect:

System.out.println (flag)

Catch and handle exception

Syntax:

New User () try

Effect:

Try {new User ();} catch (Exception e) {e.printStackTrace ();}

Throw an exception

Syntax:

New Exception () throw

Effect:

Throw new Exception ()

Lock a variable

Syntax:

String.synchronized

Effect:

Synchronized (string) {} so far, I believe you have a deeper understanding of "what idea code completion features". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Effects syntax variables conditions types codes functions tests elements content objects journeys statements learning utility deeper two global interest practicality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Shulou Tech Info Docker Linux vpn