Hello... Progmmaer Wall is blog of a Prgrammer.

Some Usefull Windows Short Keys

+ No comment yet

  • Windows Key  : Open or close the Start menu.
  • Windows Key  + R : Will open run dialog.
  • Windows Key + E : Will open file explorer.
  • Windows Key + L : Will lock your machine.
  • Windows Key + D : Will display the desktop.
  • Windows Key + M : Will minimize all windows.
  • Windows Key + T : Will cycle through programs on the taskbar.
  • Windows Key + <number> : :Will start the program pinned to the taskbar in the position indicated by the number. If the program is already running, switch to that program.


Windows Key

Useful Browser Tricks

+ No comment yet

Turn your browser into quick notepad

Type the following command in browser's URL bar and hit enter
data:text/html, <html contenteditable>

Useful Command Prompt Tricks

+ No comment yet

Save typed command history for future use 

We often execute a lot of commands, on command prompt and then as soon as we close it, all the history is lost. This is especially very cumbersome, when you run down with huge commands.

After you're done with the all the commands, Just type doskey /history > D:\commands.log in your command prompt and boom, All the command prompt history will be saved in a file named commands.log in C directory.



Useful Shortcuts On Windows

+ No comment yet

Tricky way of opening cmd till a particular directory

  • Go to the folder where you want to open the command window. Press 'Shift key' + 'RightClick'. You can see the pop-up as shown below which will have an option 'Open command window here'.



End Result
  • Try Alt+D, then type 'cmd' and then press Enter result will be same as above.

Java Strings

+ No comment yet
Java strings are sequence of Unicode characters. In Java we do not have any built in string data type, instead Java libraries contains a class String. So each quoted string in java nothing but an instance of this built in String class.

In Java there are two different ways of creating a String.
  1. Either using a new operator : String myString = new String("Hello");
  2. or using string literal :  String anotherString = "welcome";
Bellow is the example demonstrating difference between these initialization.

String s1 = new String("abc") ;
String s2 = new String("abc") ;
String s3 = "abc" ;
String s4 = "abc";

Then
s1 == s2 returns false
s1 == s3 returns false
s3 == s4 returns true.

This is because s3 and s4 refers to the same object, and s1 and s2 created using new operator refers to the different objects. The basic difference between them is memory allocation, JVM maintains a special area of memory for storing string literal called "String constant Pool". When you create a string using literal, it checks the pool to see if an identical String already exist, if so then it will direct it's reference to the already existing String object, if not then it will create a new String object in this pool. When you create a String using new operator it will create two objects, one in normal memory (heap) and the literal "abc" will be placed in pool.

In Java String is an immutable object. An immutable object is an object whose attributes values can not be modified. In Java once you create a String object, you can not  modify it to some other object or different String. Imagine the concept of StringPool, what if String is not immutable. A String object may have more then one reference variables, so if any of them change it's value others will automatically get affected.