Access Control Modifiers: Java Why Local Variable Should Be Initialized??
Access Control Modifiers: Java Why Local Variable Should Be Initialized??
1.
2.
Without explicitly referring to the instance in the Print method, how would it know it should print 1 and not 2?
3.
why there can be only one public class per source code file
This restriction is not yet enforced by the compiler, although it's necessary for efficient package importation"
It's pretty obvious - like most things are once you know the design reasons - the compiler would have to make an additional pass through all the compilation units
(.java files) to figure out what classes were where, and that would make the compilation even slower.
4.
5.
6.
7.
Whenever a method is called with conflicts , it will look for best and clear and
simple match
import java.util.*;
import java.text.*;
Pattern r = Pattern.compile(pattern);
Here is the table listing down all the regular expression metacharacter
syntax available in Java
Subexpression
Matches
[...]
[^...]
\A
\z
\Z
re*
re+
re?
re{ n}
re{ n,}
re{ n, m}
a| b
Matches either a or b.
(re)
(?: re)
(?> re)
\w
\W
\s
\S
\d
\D
\A
\Z
\z
\G
\n
\b
\B
\Q
\E
Bubble sort We are sending the biggest number to the end by comparing
two numbers and starting the loop again from 0.
Insertion sort-Like playing card. We will pick a card and place it after
comparing with the pack of card we had.