Showing posts with label java que. Show all posts
Showing posts with label java que. Show all posts

Thursday, 6 December 2018

Second topmost repeated string in paragraph.

Q. How to find second topmost repeated string in paragraph using any programming language?

ANS:- using HashMap we can store string's as a key and its occurrence as a value and after that we can return highest repeated occurrence as a value. in this video i was given a full explanation of its

Thursday, 17 August 2017

Java all keywords easy to understand


java support 50 keywords to perform different operation in java program they are

1] Package creation and usage (2)
      1.package
      2.import

Tuesday, 1 August 2017

Different ways of reading input from keyboard/end user:

I know only 6 methods to read input from keyboard/user.......

1. Command line argument
2. System properties
3. java.util.Scannner(from jdk1.5)
4. using console (from jdk1.6)
5. BufferedReader
6. using AWT / SWING

How to find out the version of jdk that is used to generate .class file ?

ANS-------------------->

Use javap tool for this as shown below 
>javap -verbose <classname>


deside the jdk version based on major version 

__________________________
major version      |   jdk                 |
++++++++++++++++++++++++
     52                 |  1.8                  |
++++++++++++++++++++++++
    51                 |   1.7                  |
++++++++++++++++++++++++
   50                 +   1.6                  |
++++++++++++++++++++++++

Thursday, 27 July 2017

When java doesn't support pointers why does it throws NullPointerException ?

ANS------------->
if we invoke method or variable on a reference variable that hold null value than NullPointerException will be thrown.

how can we make our java program run from any location irrespective of its original location ?

how can we make our java program run from any location irrespective of its original location ?

ANS----------------->

Can we execute java application without main method ?

Can we execute  java application without main method ?

ANS----------------->

java diff between constructor and static block

Q. what is difference between  constructor and static block ? 
Ans------->