BHIM: UPI Payment App by Narendra Modi APK Download

BHIM: UPI Payment App by Narendra Modi APK Download
BHIM : Bharat Interface for Money or Bhim Payments is the latest app launched by Narendra Modi to boost Digital Payements in India. BHIM is developed by National Payments Corporation of India , and is based upon UPI – Unified Payments Interface. Thus, by using UPI you can easily link your mobile number and start receiving and sending money to any other bank account by simple taps. Here’s how you can download BHIM app apk or by Play store to start receiving Payments.
How to Download BHIM App on Android ?
How to use BHIM app – Review & Features ?
Bhim App for Android
  • Before we move onto the review let’s have a look onto the features of BHIM App – by NPCI
  • Features – 
    1. As its launched by NPCI – Its based upon UPI (Unified Payments Interface) thus, you can send or transfer money to any bank account instantly!
    2. There’s no time limit, you can send or receive your money anytime, anywhere 24 x 7.
    3. Besides, this you can also use QR code to scan to pay or receive money.
    4. All the money you accept by BHIM will be instantly trasferred to your Bank account, no delays!
Review –
  • Once, you have downloaded & installed the Bhim app – It will ask you to Enter your mobile number & permission to send an SMS to the UPI.
  • Here, enter your mobile number, and tap on “OK”. ( Note – please keep in mind to register using the same mobile number which you use with bank  as the app automatically fetches account numbers linked to mobile number
  • In the next step,  you will be asked to register your passcode as shown in the image below –
    Bhim App Enter Passcode
    Bhim App Enter Passcode
    Here, enter your “4 digit secret passcode” .
    Please do not share your Passcode with anybody, as it will be your secret password to log-on to the Bhim app.
  • Once you have finished setting up the passcode, it will now ask you to select your default Bank Account which will be used to Send money or accept money as shown in the image below –
    Bhim App Bank account selection
    Bhim App Bank account selection
    Once you select your Bank, the best thing about BHIM is that it will automatically get the account number & IFSC code details of your bank account, just by using your mobile number which was entered. (Hence, please keep in mind to register using the same mobile number which you use with bank)
  •  It pretty nicely detected my Bank of Baroda account details as shown in the image below –
    BHIM App bank account details detection
    BHIM App bank account details detection
    Here simply “Tap on the account number” to link your bank account to Bhim UPI Payments app.
  • Further, you may be asked to verify your Bank account either by debit card, or credit card expiry date depending upon the bank you selected.
  • Once, you have finished setting up ! you are ready to start accepting & paying using the UPI Payments interface by Bhim!
  • Click here to Download & Install BHIM app from Google Play StoreOr
    you can Download BHIM app apk from the link below –Click here to Download BHIM app Apk for Android
Bhim app is working fine all android versions such as Kitkat, lollipop, marshmallow, and Nougat too! . Bhim app for iPhone & iOS link will be posted shortly!
This , is a good step by the Government of India by making it easier to use Digital currency for payments, do let us know your views about this in the comments section below !

Two killed in road accident in Nashik

Two killed in road accident in Nashik
Two people, including a girl, were killed and 19 others injured when a car collided head-on against a motorcycle near Saat-Moori village on Lasalgaon-Kolpewadi road nearLasalgaon in Nandgaon taluka of the district.
Around 19 residents of Ahmednagar were travelling in a car towards Satana while a motorcyclist was coming from opposite direction last evening, when the mishap occurred, police said.
In the accident, two people, including the motorcyclist and a five-year-old girl passenger from the car, died on the spot.
The deceased have been identified as motorcyclist Vilas Yadav Pagare (35) of Belapur village and the girl Kalyani Balu Ghoderav.
Nineteen injured persons were immediately moved to Niphad rural hospital while six seriously injured were shiffted to Nashik civil hospital for treatment.
The driver of car has been absconding since the incident, sources said, adding that the Lasalgoan police have registered a case of accidental death in this regard.

No more visa-free entry for Indians to Hong Kong


In a setback to Indian travellers, the Hong Kong, a special administrative region of China, has withdrawn the visa-free facility for Indians and they will now have to complete a pre-arrival registration from January.
"The Pre-arrival Registration for Indian Nationals will be implemented on January 23, 2017. The online service for 'Pre-arrival Registration for Indian Nationals' is now opened," the Hong Kong immigration department said in an announcement on its official website.

"Indian nationals must apply for and successfully complete pre-arrival registration online before they can visit or transit the HKSAR visa-free (if seeking to enter the HKSAR during transit). Pre-arrival registration is not required for Indian nationals in direct transit by air and not leaving the airport transit area," it said.
This is a major set back for over half a million Indians who visit the former British colony for business, trade and holidays.
Till now Hong Kong, which is now a Special Administrative Region of China, has permitted Indians to enter with valid passport for a period up to 14 days without a visa. But the facility has been withdrawn despite representations from India ostensibly on the ground that the number of Indian asylum seekers was on the rise, official sources told PTI here.
Indian officials say that Hong Kong is using the asylum seekers as pretext to deny the visa free entry to Indians who are one of the largest spenders contributing the local economy.

Compare BSNL unlimited call offer: All you need to know about the plans


Telecom major BSNL is all set to take on rivals Bharti Airtel and Reliance Jio with its Rs 149 monthly unlimited voice call plan for mobile subscribers. 

BSNL will roll out  an unlimited local and national voice call plan to any network with a bit of free data for Rs 149 or less next month.

BSNL is all set to give a tough competition to other telco companies by its new offerings. It has recently announced unlimited calling offer that starts at a price of Rs 99 for its pre-paid customers along with limited free data usage.

Here are the top 4 schemes that the customers must know before actually availing the offer:

1. Rs 99 offer: This scheme offers free unlimited voice calls (local) and free STD calls from BSNL to BSNL  along with 300MB of data. The plan is valid for 28 days and is applicable in Kolkata, Assam, Assam, Jammu & Kashmir, Rajasthan, Gujarat, Madhya Pradesh and Maharashtra.

2. Rs 149 offer: BSNL is also offering unlimited voice calls and free STD BSNL to BSNL calling along with 300MB data which is valid for 28 days. This is applicable for Himachal Pradesh and Kerala circles.

3. Rs 119 offer: This plan gives free unlimited local voice calls and free STD BSNL to BSNL calls; with 300MB data which is again valid for 28 days. This will be applicable in Uttaranchal, and Uttar Pradesh east and west circles.

4. Rs 339 offier: This scheme gives unlimited local voice calls along with free STD BSNL to BSNL calls and 1GB data. It is valid up to 28 days.

Meanwhile, Reliance Jio is offering a Rs 149 plan under which it will offer free calls to all network in the country for 28 days without any roaming charges. The plan also includes 300MB of 4G data  during the day and unlimited usage at night. Bharti Airtel, Vodafone and Idea Cellular  also attemped to match Reliance Jio'd scheme by offering free calls and limited mobile internet  priced at around Rs 150 and Rs 350, respectively. 

 Anupam Shrivastava, CMD, BSNL said that the reinforcement path of BSNL is underway. With the improvement in financial situation, BSNL is now buoyant of earning the net profit and thereafter become one among the three top telecom operators of India. 

Here are the offers of other telecom companies that fall in the same precinct: 

1. Airtel: Airtel has also launched unlimited calling packs for prepaid users. The Rs 145 Airtel pack provides users the option to make local and STD calls to any Airtel user across the country. This offer also provides the user with 300MB of 4G data. Airtel’s Rs 345 scheme also offer unlimited voice calls to any network across the country. 

2. Vodafone: Vodafone has a number of unlimited calling and mobile data offers for prepaid and postpaid customers. It provides a double data offer which comes with a recharge of Rs 255 or above. Vodafone unlimited calling prepaid recharge pack, priced between Rs 144 and Rs 149  provides unlimited local and STD calls as well as 300MB of 4G data and free incoming calls on national roaming. 

3. Idea Cellular: Idea Cellular has also come up with Rs 148 offer that allows users to make unlimited local and STD calls to Idea users, as well as 300MB of 4G data. The Rs 348 plan allows users to make unlimited calls to any network in the country, plus 1GB of 4G data. 

Hitachi Achieves 0.05-mm Square Super Micro RFID Tag, 'Further Size Reductions in Mind'


At ISSCC 2007, Hitachi, Ltd. and Renesas Technology Corp. have delivered a lecture (lecture number 26.6) about their micro RFID tag (wireless tag) IC measuring only 0.05 x 0.05 x 0.005 mm. This is as small as 2/27 their "next-generation mu-chip" measuring 0.15 x 0.15 x 0.0075 mm announced at the preceding ISSCC in 2006. This IC was manufactured using 90-nm CMOS technology using SOI substrates. It features a three-layer metal wiring layer and a 21 x 32 μm memory chip capable of recording 128-bit data. It is attached to a separately-provided external antenna when used, and communicates with the RFID tag reader via the 2.45 GHz band. Maximum communication range is 300 mm. Mitsuo Usami, Senior Chief Researcher at Hitachi's Central Research Laboratory who delivered the lecture, said its power when transmitting data is "slightly less than 1 mW."

Like the preceding 0.15-mm square model, this RFID tag IC also features electrodes on both surfaces for antenna connection. It is because, considering the IC's micro size, it will cost too much if manufacturers have to distinguish which side is which when they bond it to the antenna. Therefore, Hitachi and Renesas made the chip have electrodes on both sides, so manufacturers no longer need to adjust its direction and location when bonding it. It assumes to be mounted on antennas with around 6-cm length, like those used for current RFID tags. "ACF" (anisotropic conductive film) is used to bond an antenna and the IC.

Electronic beam (EB) is used for the memory part's lithography. As the reasons to have employed EB, Usami cited (1) it allows easy manufacturing of finer transistors in the future, (2) memory chips manufactured using EB can maintain high reliability even in a high-temperature environment at 400 degrees, and (3) it requires no one-time use only mask to mark unique ID patterns. EB equipment is known to cost a lot, but Usami insisted, "This time, we can make 4 million IC chips out of a wafer sheet. This winds up concerns about EB costs. By making an IC chip much smaller, we became able to use an extravagant lithography technology rather more easily than before."
He also explained Hitachi employed SOI substrates for manufacturing process technology to enhance isolation from factors including parasitic capacity of the IC's peripheral components. "Downsized ICs tend to cause more latch-up occurrence due to parasitic capacity of other components around the IC, among other factors, and adverse voltage might run into the IC depending on circumstances. We used to add a guard ring to prevent this before, but what mattered was a guard ring resulted in a larger IC. SOI substrates were essential to the size reduction," said Usami.
Hitachi and Renesas plan to create a 12-μm square IC by miniaturizing the manufacturing technology to 65-nm rule and then to 23-nm rule. Usami said, "If using EB, we will surely be able to miniaturize memory part as well."
A hurdle to overcome lies in PC performance required to process lithography patterns, rather than the manufacturing technology itself. Usami added, "It takes a long time for a PC to process information by linking numerous patterns. This will determine the manufacturing throughput after all."

Deposit banned notes in one go to escape queries: Finance Minister Arun Jaitley


NEW DELHI: After tightening rules for depositing old 500 and 1000 rupee notes, Finance Minister Arun Jaitley tonight said no questions will be asked if any amount of junked currency is deposited in one go but repeated deposits may raise queries. 

With nearly Rs 13 lakh crore out of the Rs 15.4 lakh crore worth of 500 and 1000 rupee junked already deposited in banks, the government has changed rules to mandate that individuals can deposit over Rs 5,000 in old currency bills only once until December 30 and that too after explaining why it had not been done so far. 

Explaining the rationale behind the move, Jaitley said all exemptions to certain sectors and utilities, which had been allowed to accept the banned currency postdemonetisation, ended last week and all those in possession of the old notes are supposed to deposit them with banks. 

Yahoo hack: 1bn accounts compromised by biggest data breach in history

The latest incident to emerge – which happened in 2013 – is probably distinct from the breach of 500m user accounts in 2014


Yahoo said on Wednesday it had discovered another major cyber attack, saying data from more than 1bn user accounts was compromised in August 2013, making it the largest such breach in history.

The number of affected accounts was double the number implicated in a 2014 breach that the internet company disclosed in September and blamed on hackers working on behalf of a government.

“An unauthorised party” broke into the accounts, Yahoo said in a statement posted on its website. The company believes the hacks are connected and that the breaches are “state-sponsored”.


Senators call Yahoo's delay in revealing breach of 500m accounts 'unacceptable'
 Read more
The hackers used “forged ‘cookies’” – bits of code that stay in the user’s browser cache so that a website doesn’t require a login with every visit, wrote Yahoo’s chief information security officer, Bob Lord. The cookies “could allow an intruder to access users’ accounts without a password” by misidentifying anyone using them as the owner of an email account. The breach may be related to theft of Yahoo’s proprietary code, Lord said.

The company began to suspect the breach in November, when law enforcement approached the company with what a third party claimed was “user data;” Lord’s post suggests that the data included forged cookies.

“For years I have been urging friends and family to migrate off of Yahoo email, mainly because I watched for years as the company appeared to fall far behind its peers in blocking and other email-based attacks,” wrote security researcher Brian Krebs as news of the attack broke. “I stand by that recommendation.”

Yahoo said the stolen user account information may have included names, email addresses, telephone numbers, dates of birth, hashed passwords and, in some cases, encrypted or unencrypted security questions and answers.

After Yahoo revealed the smaller – but still historic – security breach in September, six US senators sent Yahoo a letter demanding the company reveal exactly when it had learned of the intrusion. Vermont senator Patrick Leahy, ranking member of the senate judiciary committe, called for a hearing; no hearing has been scheduled thus far.

The senators, including Leahy, said they were “disturbed that user information was first compromised in 2014, yet the company only announced the breach last week.” The six legislators found the reveleation that “millions of Americans’ data may have been compromised for two years” to be “unacceptable.”

The company is being acquired by Verizon for $4.8bn but the sale has not been an easy one. In October, a report revealed that the company had cooperated with the NSA to scan users’ emails for keywords on behalf of the agency.

A Verizon lawyer, Craig Silliman, said that the September breach had clearly damaged Yahoo’s value and hinted that the damage ought to be reflected in the buying price. “I think we have a reasonable basis to believe right now that the impact is material and we’re looking to Yahoo to demonstrate to us the full impact,” Silliman told reporters in October. “If they believe that it’s not, then they’ll need to show us that.”

Email breaches remain especially vexing to users, since they can reveal bank and family details as well as passwords that users share between systems or have received in their email accounts. Password-sharing has become so common that databases of login information are often used by hackers to test for email-and-password combinations on retailer websites like Walmart or Amazon.

Payment card data and bank account information were not stored in the system believed to be affected, the company said. Yahoo is notifying all the users affected and asking them to change their passwords. Yahoo owns assets far beyond its popular webmail service and its news site: other properties include blogging platform Tumblr and photo-sharing site Flickr, as well as Yahoo Finance.

Java interview questions for One year experience

Java interview questions for One year experience
 Java interview questions

What are Native methods in Java?

Java applications can call code written in C, C++, or assembler. This is sometimes done for performance and sometimes to access the underlying host operating system or GUI API using the JNI.

The steps for doing that are:

First write the Java code and compile it
Then create a C header file
Create C stubs file
Write the C code
Create shared code library (or DLL)
Run application


What are class loaders?

The class loader describes the behavior of converting a named class into the bits responsible for implementing that class.

Class loaders eradicate the JREs need to know anything about files and file systems when running Java programs.

A class loader creates a flat name space of class bodies that are referenced by a string name and are written as:

Class r = loadClass(String className, boolean resolveIt);


What is Reflection API in Java?

The Reflection API allows Java code to examine classes and objects at run time. The new reflection classes allow you to call another class's methods dynamically at run time. With the reflection classes, you can also examine an instance's fields and change the fields' contents.

The Reflection API consists of the java.lang.Class class and the java.lang.reflect classes: Field, Method, Constructor, Array, and Modifier.


Explain the difference between static and dynamic class loading.

The static class loading is done through the new operator.

Dynamic class loading is achieved through Run time type identification. Also called as reflection

This is done with the help of the following methods:

getClass(); getName(); getDeclaredFields();
Instance can also be created using forName() method. It loads the class into the current class memory.


Explain Shallow and deep cloning.

Cloning of objects can be very useful if you use the prototype pattern or if you want to store an internal copy of an object inside an aggregation class for example.

Deep cloning - You clone the object and their constituent parts.

It should be used when it is inappropriate to separate the parts; the object is formed of, from it.

Shallow cloning - You clone only the object, not their parts. You add references to their parts.

It should be used when it is adequate to have the references added to the cloned object


What is the purpose of Comparator Interface?

Comparators can be used to control the order of certain data structures and collection of objects too.

The interface can be found in java.util.Comparator

A Comparator must define a compare function which takes two Objects and returns a -1, 0, or 1

Sorting can be done implicitly by using data structures of by implementing sort methods explicitly.

Explain the impact of private constructor.

Private Constructors can't be access from any derived classes neither from another class.

So you have to provide a public function that calls the private constructor if the object has not been initialized, or you have to return an instance to the object, if it was initialized.

This can be useful for objects that can't be instantiated.

What are static Initializers?

A static initializer block resembles a method with no name, no arguments, and no return type. There is no need to refer to it from outside the class definition.

Syntax:

static

{

  //CODE

}

The code in a static initializer block is executed by the virtual machine when the class is loaded.

Because it is executed automatically when the class is loaded, parameters don't make any sense, so a static initializer block doesn't have an argument list.


Define the purpose of Externalizable Interface.

The Externizable interface extends the serializable interface.

When you use Serializable interface, your class is serialized automatically by default. But you can override writeObject() and readObject()two methods to control more complex object serailization process.

When you use Externalizable interface, you have a complete control over your class's serialization process. The two methods to be implemented are :

void readExternal(ObjectInput)

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

void writeExternal(ObjectOutput)

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.


What are transient and volatile modifiers?

When serializable interface is declared, the compiler knows that the object has to be handled so as so be able to serialize it. However, if you declare a variable in an object as transient, then it doesn’t get serialized.

Volatile
Specifying a variable as volatile tells the JVM that any threads using that variable are not allowed to cache that value at all.

Volatile modifier tells the compiler that the variable modified by volatile can be changed unexpectedly by other parts of the program.


What are daemon threads?

Threads that work in the background to support the runtime environment are called daemon threads.
Eg garbage collector threads.

When the only remaining threads in a process are daemon threads, the interpreter exits. This makes sense because when only daemon threads remain, there is no other thread for which a daemon thread can provide a service.

You cannot create a daemon method but you can use
public final void setDaemon(boolean isDaemon) method to turn it into one.


What is JAVAdoc utility?

Javadoc utility enables you to keep the code and the documentation in sync easily.

The javadoc utility lets you put your comments right next to your code, inside your ".java" source files.

All you need to do after completing your code is to run the Javadoc utility to create your HTML documentation automatically.


Explain the difference between StringBuilder and StringBuffer class.

StringBuilder is unsynchronized whereas StringBuffer is synchronized. So when the application needs to be run only in a single thread then it is better to use StringBuilder.

StringBuilder is more efficient than StringBuffer.


Explain semaphore and monitors in java threading.

A semaphore is a flag variable used to check whether a resource is currently being used by another thread or process.

The drawback of semaphores is that there is no control or guarantee of proper usage.

A Monitor defines a lock and condition variables for managing concurrent access to shared data. The monitor uses the lock to ensure that only a single thread is active in the monitor code at any time.

A semaphore is a generalization of a monitor. A monitor allows only one thread to lock an object at once.


Describe synchronization in respect to multithreading.

Multithreading occurs asynchronously, meaning one thread executes independently of the other threads. In this way, threads don’t depend on each other’s execution. In contrast, processes that run synchronously depend on each other. That is, one process waits until the other process terminates before it can execute


What are Checked and UnChecked Exception?

The java.lang.Throwable class has two subclasses Error and Exception. There are two types of exceptions non runtime exceptions and runtime exceptions. Non runtime exceptions are called checked exceptions and the unchecked exceptions are runtime exceptions.

Runtime Exceptions occur when the code is not robust and non runtime exceptions occur due to the problems is environment, settings, etc.


What are different types of inner classes?

Local classes - Local classes are like local variables, specific to a block of code. Their visibility is only within the block of their declaration

Member classes - Member inner classes are just like other member methods and member variables and access to the member class is restricted, just like methods and variables.

Anonymous classes - Anonymous classes have no name, you cannot even provide a constructor.


What is serializable Interface? 

If we want to transfer data over a network then it needs to be serialized. Objects cannot be transferred as they are. Hence, we need to declare that a class implements serializable so that a compiler knows that the data needs to be serialized.


How does thread synchronization occurs inside a monitor? 

A Monitor defines a lock and condition variables for managing concurrent access to shared data. The monitor uses the lock to ensure that only a single thread is active in the monitor code at any time. A monitor allows only one thread to lock an object at once.


What is the difference between AWT and Swing?

Classes in swing are not OS dependent. They don’t create peer components, so they are light weight unlike AWT.

They don’t take the look and feel of the target platform so they have a consistent appearance

What is meant by Stream Tokenizer?

The StreamTokenizer class takes an input stream and parses it into "tokens", allowing the tokens to be read one at a time. The parsing process is controlled by a table and a number of flags that can be set to various states. The stream tokenizer can recognize identifiers, numbers, quoted strings, and various comment styles.


What is resource bundle?

The place where an application stores its locale-specific data (isolated from source code).

When your program needs a locale-specific resource your program can load it from the resource bundle that is appropriate for the current user's locale.


What is a thread? What are the advantages we derived by programming with thread?

Threads allow programs to execute simultaneously. A thread is an independent path of execution in a program. These threads can be executed synchronously or asynchronously. All threads have a priority attached. Thread with a higher priority is executed first.

Advantages:
Allows multiple programs to be executed concurrently
Cost of thread is low compared to processes in terms of space and communication.
Threads are lightweight.


Explain how to create a thread and start it running.

Creating a thread:
Declare a class as a sub class of Thread
Class SampleThread extends Thread
{
Long minSample; {
SampleThread( Long minSample);
}
Public void run()
{
Program goes here
}
}
Run the thread: An instance is created to start the thread.
SampleThread s = new SampleThread(100);
s.start();


What is multithreaded program? What is the importance of thread synchronization?

A multithreaded program involves multiple threads of control in a single program. Each thread has its own stack. Other resources of the process are shared by all threads and while trying to access them it should be synchronized.

Importance of thread synchronization:
Avoids issues like deadlocks and starvation
Can be used for de bugging multi threaded programs


What is the difference between yielding and sleeping?

Sleep holds the threads execution for the specified time. On the other hand, yield will cause the thread to rejoin the queue. When a task is invoked in yielding, it returns to the ready state. While when a task is invoked in sleeping, it returns to the waiting state.


What is the difference between C++ & Java?

Java does not support Enums, Structures or Unions but supports classes.
Java does not support multiple inheritance or operator overloading
Java allows functions to be overloaded
In java, memory leaks are prevented by automatic garbage collection
C++ allows direct calls to be made to the native system libraries. On the other hand java calls these libraries trough java native interface.
In c++ parameters are passed by either value or pointers. In java, due to the absence of pointers, parameters are passed by value.


What is JAR file?

JAR is a Java Archived file which allows many files to be stored. All applets and classes can be stored in a JAR file thereby reducing the size. JAR files can be created using the JAR command that comes with JDK. This JAR file can also be digitally signed. In this case, the JAR file itself is not signed. But, all the files inside it are signed.


What is JNI?

Java Native Interface is a framework that allows the Java code running in the Java Virtual Machine to interact and communicate with other applications and libraries written in some other languages. JNI is typically used when an application cannot be entirely written in Java. JNI can be invoked only by signed applets and applications.


What is serialization?

Serialization is an operation in which an object’s internal state is converted into a stream of bytes. This stream is then written to the disk. This stream can also be sent over a socket. Serialization is a very compact and accurate method. For any object to be serialized .it must be an instance of a class that implements either the Serializable or Externalizable interface.

Uses of serialization:
Helps to persist data for future use
To exchange data between servlets and applets
To store users session


How are Observer and Observable used?

The observer pattern in java is known for its use in design. Whenever an observable object changes its state, its corresponding observer classes are notified. Observable is implemented as a class which includes methods for managing Observer lists and notifying Observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state.  For example, third-party software cannot be made Observable without changing an existing class hierarchy.

What is synchronization and why is it important?

Java supports multiple threads to be executed. This may cause two or more threads to access the same fields or objects. Synchronization is a process which keeps all concurrent threads in execution to be in synch. Synchronization avoids memory consistence errors caused due to inconsistent view of shared memory. When a method is declared as synchronized; the thread holds the monitor for that method's object. If another thread is executing the synchronized method, your thread is blocked until that thread releases the monitor.

Does garbage collection guarantee that a program will not run out of memory?

Garbage collection does not guarantee that a program will not run out of memory. The garbage collection is dependant on the JVM. Hence it is possible for the resources to be used faster than they are garbage collected. Garbage collection cannot be predicted if it will happen or not.


What is the difference between a break statement and a continue statement?

A break statement when applied to a loop ends the statement. A continue statement ends the iteration of the current loop and returns the control to the loop statement. If the break keyword is followed by an identifier that is the label of a random enclosing statement, execution transfers out of that enclosing statement. If the continue keyword is followed by an identifier that is the label of an enclosing loop, execution skips to the end of that loop instead.

What are synchronized methods and synchronized statements?

Synchronized methods

When a method in Java needs to be synchronized, the keyword synchronized should be added.
Example:
Public synchronized void increment()
{
X++;
}

Synchronization does not allow invocation of this Synchronized method for the same object until the first thread is done with the object. Synchronization allows having control over the data in the class.

Synchronized Statement:

A synchronized Statement can only be executed once the thread has obtained a lock for the object or the class that has been referred to in the statement. Synchronized statement contains a synchronized block, within which is placed objects and methods that are to be synchronized.
Example:

public void run()
{
     synchronized(p1)
     {
            //synchronize statement. P1 here is an object of some class P
            p1.display(s1);
     }
}


For more questions with answers, follow the link below:

http://www.careerride.com/Java-Interview-Questions.aspx


We do not warrant the correctness of content. The risk from using it lies entirely with the user. While using this document, you agree to have read and accepted the terms of use and privacy policy.



C#.NET/VB.NET interview Question for 1 year experence

C#.NET/VB.NET interview Question for 1 year experence
Explain the elements of the .NET Framework. a.          CLR (Common Language Runtime): It is a common managed environment where all the .net programs run. Supports multiple languages and has the garbage collector.

 b.        .Net Framework Class Libraries:  For each source code compiler (VB.NET, C#.NET, etc.), there is a minimum set of coding standards that must be met. The minimum set of coding
standards that must be met to compile .NET code into MSIL code is known as CLS - CommonLanguage Specification. The role of the Common Language Specification is to ensure that allgenerated code (MSIL) that meets the minimum set of coding standards can operate successfullywithin the .NET framework. THE CTS (Common Type System) handles conversion ofprogramming-language data types into .NET compatible (MSIL) data types. The implicit benefit ofthe CTS is the reduction of development time when attempting to coordinate data types betweentwo sets of different programming-language code. c.          Data and XML: Support for disconnected programming model and XML.
 d.          XML webservices: creating webservices for distributed architecture.
 e.          Webforms: Provides support and functionality for Web based UI.
 f.           Windows forms: Provides support and functionality for Windows based UI.
 What is assembly manifest? What is the information it provides. Assembly Manifest is a file that contains data that describes how the elements present inside an
assembly are connected to each other. The assembly manifest contains assembly metadata todefine the scope of the assembly and resolve references to resources and classes. Information provided by Assembly Manifest:
a.    Assembly Name
b.    Version Number
c.    Culture
d.    Strong name
e.    List of files inside the assembly
f.     Reference information Explain how a .NET application is compiled and executed Any code written in any .NET complaint languages when compiled, converts into MSIL (Microsoft
Intermediate Language) code in form of an assembly through CLS, CTS. IL is the language that
CLR can understand. On execution, this IL is converted into binary code by CLR’s just in timecompiler (JIT) and these assemblies or DLL are loaded into the memory.  Describe the .NET base class library.NET’s Base class library exists in order to encapsulate huge number of common functions and
makes them easily accessible to the developer. .NET base class library provides the functionalitylike ADO.NET, XML, Threading, IO, Security, Diagnostics, Resources, Globalization, collections etc.It serves as the main point of interaction between developer and runtime.
  Explain the difference between value types and reference types Value Type:
a.    Stores the data.
b.    The value of value types is stored on the managed stack.
c.    One variable can have just one value.
d.    They are lighter objects.Reference Type:
a.    Stores the reference to the data.
b.    A reference type is allocated on the heap.
c.    several variables can reference the same data
d.    They are heavier objects. Explain the importance of Imports and Using Statements. Import statement: creates a property on the global object with the name supplied as namespace
and initializes it to contain the object that corresponds to the namespace being imported. Anyproperties created using the import statement cannot be assigned to, deleted, or enumerated.All import statements are executed when a script starts. Using statements:  mainly defines the namespaces whose objects will be used in the form.
This clearly solves 2 purposes: Defines all the namespaces that will be used in a form.Secondly, reduces the hassle for the programmer to type the name of namespace again andagain while using classes/objects that belong to the namespace. Explain the difference between a class and a structure Class:
a.    It is reference type.
b.    Null value can be assigned to a variable in a class
c.    It can have destructor.
d.    All variables in classes are by default private.
e.    Good to be used from architecture view as it provides high flexibility.
Structure:
a.    It is value type.
b.    Null value assignment is not feasible here.
c.    Cannot have destructor.
d.    All variables in structures are public.
e.    Good to be used for simple data structures.
     Explain how garbage collection manages the reclamation of unused memory. The garbage collector assumes that all objects in the managed heap are garbage. It starts walking the roots and builds a graph of all objects reachable from the roots recursively. It stops when it
attempts to add an object to the graph that it previously added. The graph contains the set of allobjects that are reachable from the application's roots. Any object/s that is not in the graph is notaccessible by the application, and is considered garbage. Collection only occurs when the heap isfull. In such a case, each and every garbage object calls the Finalize method and reclaims theunused memory. 55. Explain how garbage collection deals with circular references. Explain how garbage collection deals with circular references. The .Net runtime knows about all the references between the objects. It can identify all the
circular references that are reachable from the root and hence finalize them to free them all atonce if and when needed. Explain the process of creating a menu using the MainMenu component. MainMenu component is a component that allows the display of Menus at runtime on a form.
Process of creating Menu using MainMenu Component:a.    Add MainMenu component on Windows Form.
b.        Menu designer allows deciding the structure of the main menu by selecting the Type
Here area and adding the Menu Items to be displayed on the menu.c.        Add functionality to Menu Items as required.
 Explain the process of creating a context menu using the ContextMenu component ContextMenu component provides the users with the ability to access some very frequently used
commands. Context menu works by right click of mouse. They mainly provide access to commands particular to the control that has been clicked upon.
 

  1. Open the windows form application.
  1. Select ContextMenu component from toolbox.
  1. A menu is added. Click on Type here and type in new Menu Items to be placed on the Menu.
  1. Provide the functionality.
  1. Associate the context menu with the form or the control it is supposed to be related to.


What is a delegate? Explain how to create it.

A delegate declares a ref type that references a named of anonymous method. Delegates are
secure and type-safe. Consider them as type safe function pointers.

public delegate void Del<T>(T item);

Del<int> d1 = new Del<int>(Notify);


Explain how to declare and raise events from your application.

Declare Events: “Event” keyword is used to declare an event.

public delegate void MyCustomHandler(object o, MyEventArgse);

public class MyEventArgs: EventArgs
{
    public readonly int Age;
   
    public MyEventArgs(int age)
    {
        Age = age;
    }   
    
}

public class MyCustomListener
{
    public void Show(object o, MyEventArgs e)
    {
        Console.WriteLine(
            "Age is {0}",
            e.Age);
    }   
}


Describe how to implement event handlers and associate them with events.
public class MyClass
{
    public static event MyCustomHandler MyEvent;
   
    public static void Main()
    {
        MyCustomListener mcll = new MyCustomListener();
        MyEvent += new MyCustomHandler(mcl1.Show);
        GetAge();
    }
   
    public static void OnMyEvent(MyEventArgse)
    {
        if(MyEvent!=null)
            MyEvent(new object(),e);
    }   
    
    public static void GetAge()
    {
        MyEventArgse1 = new MyEventArgs(25);
        OnMyEvent(e1);
               
    }
       
}


What is Break Mode? How to set breakpoints?

Break mode is the state of an application when the execution gets paused and allows the
developer to edit the value in the current state. To attain a break mode we can do any of the
following steps:
a.    Selecting Break from the Run menu (Ctrl+Break) or pressing the pause button.
b.    Reaching to break point.

Setting up the break points:
a.     Go to the line where you need to mark the breakpoint.
b.     Click with mouse on left corner margin of that line.
c.     Another way is to press F9  


Describe how to step through code in .NET.

Steps to step through the code in .NET:
a.       Start the program in debug mode.
b.      When the first breakpoint is reached then step through can be done in one of the two
ways:
i.             Press F10 to move to next line.
ii.            Select debug menu and click on step over. This would step over the breakpoint
to next level.
c.       Other options are: “Step Into” and “Step Out”.


Describe the debugging windows available in .NET.

Debug->Windows:
Breakpoints: displays a list of all the breakpoints and where they are. Shows condition when that
breakpoint will be hit if a condition exists and the Hit Count shows the number of times that
breakpoint has been hit.

Output: Displays the status messages for various features in the IDE. It shows the output form a
list of objects throughout debug mode of the application.

Immediate: This window allows the programmer to write code and verify values through
programming while debugging the application. It helps in checking the values of objects/controls
etc, and the conditions throughout the application in debug mode.

What are Debug and Trace classes? Explain how to use them to display error classes.

Both are used to help programmers find errors, occurring events and flow of code. In release
mode, however, debug class is disabled and only Trace class is valid to trap things in a live
application.
Both have assert functions to validate values.

Trace.WriteLine(variable value or comment).
Debug.WriteLine(variable value or comment).

We could create error handlers to trap unhandled exceptions trapped by Trace and Debug class.

Describe how to create Trace Listeners and log Trace output.

[Conditional("TRACE")]
public static void InitializeUnhandledExceptionHandler()
{
    AppDomain.CurrentDomain.UnhandledException +=
             new UnhandledExceptionEventHandler(CutomExceptionHandler);
}
public static void CustomExceptionHandler(object sender,
                                       UnhandledExceptionEventArgs args)
{
    Exception e=(Exception) args.ExceptionObject;
    Trace.WriteLine("Exception: "+e.Message+"\n"+e.GetType() +
                    "\nStack Trace:\n"+e.StackTrace);
    MessageBox.Show(
        "An error has occurred:"+e.Message+"\nin: "+e.GetType(),
        "Fatal",
        MessageBoxButtons.OK,
        MessageBoxIcon.Stop,
        MessageBoxDefaultButton.Button1);
    Trace.Close();
    Process.GetCurrentProcess().Kill();
}

[Conditional("DEBUG")]
public static void TrapDebug(string str)
{  
    Debug.WriteLine("Debug error: "+str);
}

What are Trace switches? Describe how to create and use Trace switches.

Trace switches allow us to filter, enable/disable the outputs through Trace. We can configure
them through the config file. 3 types of trace switches:
BooleanSwitch: Enable/Disable trace statements.
TraceSwitch and SourceSwitch: used for trapping particular Trace levels.

BooleanSwitch dataSwitch =
   new BooleanSwitch("Comment", "module1");
TraceSwitch generalSwitch =
   new TraceSwitch("comment",
   "module1");

Explain how to configure Trace switches in the application’s .config file.

switches are configured using the .config file

<system.diagnostics>
   <switches>
      <add name="MyTraceSwitch" value="1" />
      <add name="TraceSwitch2" value="1" />
   </switches>
</system.diagnostics>
both are on.

Explain how exceptions are handled by the common language runtime in .NET.

The CLR uses a technique generally referred to as a two-pass exception review process. What this
means is that the CLR will process an exception in two passes. In the first pass, the CLR will
determine if there is a handler for the exception. This is done by reviewing the entries in the
SEH table; specifically it looks at the Try Offset and Try Length flags to see if the exception
occurred within a guarded block, and if so, whether the Flags entry dictates that a handler exists
for this type of occurrence. Let's assume that the CLR did find a handler during the first pass. At
that point the CLR begins a second pass of the SEH table during which it will work through the
execution phase of the exception management process. So we can divide the two passes into a
discovery pass, in which we determine whether there is a handler in this method context to
handle the exception; and an execution pass, in which we actually execute the handler and any
special rules.
When code throws an exception, the CLR looks up the call stack looking for a catch filter to
handle the exception. When it finds the relevant catch block, before executing the code, it will
execute all code in all finally blocks - starting from the try block that threw the exception and
stopping with the catch filter that matches the exception. when the CLR encounters an exception
for a method it will use the descriptors in the SEH table to determine how to handle the
exception, which code block is affected, and what handler should be invoked.

Describe the different types of user-authored controls in NET.

User authored controls are which not part of the .net framework library. It includes both custom
controls and user controls.

a.    Custom Controls: They look similar to ASP.NET controls. They can be created in one of
the 3 ways:-
a.    Deriving a custom control from existing custom control.
b.    Making a composite custom control by combining 2 or more existing controls
c.    By creating a new control from scratch by deriving the control from its base class.

b.     User Controls: enables a part of ASP.NET page to be reused. The reusable part is in form
of a control with the extension .ascx. They look like to be a group of ASP.NET controls which
can be used over and over again.

Explain with code sample how to create an inherited control.

Steps to create inherited Control:-
a.    Create a new project.
b.    Add a custom control to the project.
c.    Change the name of the class you need to inherit the control from the base class. E.g.
inherit the class from System.Windows.Forms.Button if the control s to be inherited from a
button class.
d.    Implement the control with custom properties and featured needed by the control.
e.    Override the OnPaint method if the control’s appearance needs to be changed.
f.     Save the build the control
g.    Reference you control into another or the same project and use the control.


Explain with code sample how to create a user control.

Steps to create a User control:
a.    Select a project
b.    Right click and add a new item (User Control - .ascx) to the selected project.
c.    Add @Control Directive
d.    Add all the controls that you want to be displayed on the User control as a part of one or
more web pages.
e.    Write the code for all the tasks to be performed by the user control.
f.     Create accessor methods for the outside world accessing this user control.

Using the User control:
a.    Register the control on the webpage it needs to be used by putting @Register directive.
b.    Specify the following attributes to the register directive:
a.    TagPrefix: defines the namespace in which the control would reside
b.    TagName: defines the name with which control is referred
c.    Src: Path of where the control is kept.
c.    Control is then used on the page using the following code:
   <TagPrefix:TagName />


Explain with code sample how to create a custom control.

Steps to create a custom control:
a.    Create a new project.
b.    Add a custom control to the project.
c.    Change the name of the class you need to inherit the control from the base class. E.g.
inherit the class from System.Windows.Forms.Button if the control s to be inherited from a
button class.
d.    Implement the control with custom properties and featured needed by the control.
e.    Override the OnPaint method if the control’s appearance needs to be changed.
f.     Save the build the control
g.    Reference you control into another or the same project and use the control.

Describe the .NET Framework architecture.
.Net framework has two components:
1.    .Net framework class library
2.    Common language runtime.
FCL facilitates the types through CTS which are common to all the supported languages. 
The CLS ensures that all languages are interoperable. This ensures that all code is managed .i.e.
code which is converted to MSIL.
The CLR has the class loader that load the MSIL code of an application into runtime, which is then
converted into native code by the JIT complier. The CLR manages code and provide services such
as memory management, threading, remoting, type safety, security, Exception handling etc.

What is the managed execution process?

Managed execution process is a process where CLR executes the managed code. The steps
involved in this process are:
a.    Choosing the right compiler
b.    Compiling the code to MSIL. This also generates the required metadata.
c.    Compile the MSIL ode to native machine code.
d.    Executing the code with the variety of services available.
What are assemblies? Describe the types of assemblies.

Assembly is a compiled output of program which are used for easy deployment of an application.
They are executables in the form of exe or dll. It also is a collection of resources that were used
while building the application and is responsible for all the logical functioning.
Types of assemblies:
a.    Private Assemblies: are accessible by a single application. They reside within the
application folder and are unique by name. They can be directly used by copying and pasting
them to the bin folder.

b.    Shared Assemblies: are shared between multiple applications to ensure reusability.
They are placed in GAC.

c.    Satellite Assemblies: are the assemblies to provide the support for multiple languages
based on different cultures. These are kept in different modules based on the different
categories available.

Explain the role of assemblies in .NET.
Assemblies are main building blocks. An assembly maybe defined as a unit of deployment.
A single assembly is a collection of types, and resources. The CLR does not understand any types
that are outside assemblies. The CLR executes the code in assemblies as they contain MSIL code.
They define type, version and security boundaries. 
Assemblies in .Net are a solution to the Dll hell problem as one can use different versions of
same assembly in different applications at the same time. To make a shared assembly, we need
to register it with GAC where as private assemblies reside in applications directory.

What are windows services? How are they differ from other .NET application?
Windows services are a way to create continuously running applications in the background.
They don’t interfere with other applications and can be run whenever a machine starts. They can
be paused if and when needed and quietly run in the background without the need of any user
intervention. Windows services can be configured to run under specific user accounts. They run
under their own windows sessions and are ideal for tasks that need to be performed periodically
or for monitoring requirements.
Main difference between windows services and other .Net applications lies in the fact that they
run in their own windows session without any user intervention in the background.
Process for creating context menus: