Can someone help me figure out what the following code does and what a line with two equal signs does? How does something equal to something equal work in this constructor?
public More ...LinkedList() { header.next = header.previous = header; }
Here is a link to the site where I saw this, and I'm trying to figure it out: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/LinkedList. java # LinkedList.0header
Reading an assignment operation from right to left:
header
header.pevious
header.previous
header.next
Bottom line: after this line, both header.previous header.nextwill refer to header.
= = . . header.next header.previous .
, ...
header.next header.previous header.
:
int val1 = 10; int val2 = 11; int val3 = val2 = val1;
val1, val2 val3 , 10
val1
val2
val3
10
, header.next, header.previous header.
As simple and similar to a = b = 10, the value 10 is assigned to the variable b (b = 10), and then the value of the variable b is assigned to the variable 10 (therefore a = 10). See here for more details .
Source: https://habr.com/ru/post/1526034/More articles:Using the last else declaration in an Else-If construct - cPython recursion and list - pythonAWS S3 404 using Ember app using history location - amazon-s3EJB-интерфейс JNDI-поиска - javaCreateNumeric Vector Method causing an error using R.NET in IronPython - rSetting up a custom domain using Amazon S3 - amazon-s3OCR and Neuron Network? - ocrAdRequest () constructor not showing - javaHow to get date format in month and day - androidПутаница Python с возвращаемыми переменными - functionAll Articles