반응형

2020/12/24 30

How can I expand a child div to 100% screen width if the container div is smaller?

How can I expand a child div to 100% screen width if the container div is smaller? The parent element of the whole page is a centered div limited to a max-width of 960px. All other elements on the page are children of that parent div. The simplified structure is the following: While the parent div shouldn't expand beyond a width of 960px, the div I called "wide-div" here should fill the entire w..

Programing 2020.12.24

Why would one mark local variables and method parameters as “final” in Java?

Why would one mark local variables and method parameters as “final” in Java? In Java, you can qualify local variables and method parameters with the final keyword. public static void foo(final int x) { final String qwerty = "bar"; } Doing so results in not being able to reassign x and qwerty in the body of the method. This practice nudges your code in the direction of immutability which is gener..

Programing 2020.12.24
반응형