Popular Posts

Wednesday, March 26, 2014

Core Java Basics.

hi friends ,
This as it is an information an eduaction related blogs, so i thought that i should start java tutorial
which may helpful to students.
So as it is the first session of this tutorial we discuss about core java basics. Here you will not find a complete java tutorial package but still you can get some useful facts about core java.This tutorial is for interview perspective.
lets starts..........


                                                         Core Java Basics

Q). What is JVM?
Ans: -   Java Virtual Machine (JVM) is a collection of program  that provide the complete environment in the system which  is required to execute the java application. This collection of program make the processor to execute the java application.
Q).     Why do  we need  JVM?
Ans:-     We need JVM to provide the environment to execute java application or  make processor to execute java application  or byte code we need JVM. Whatever the OS is doing in case of ‘C’ application all this provided by the JVM due to which workload of the OS decreases.  Something like JVM  is not available in the  ’C’  application since Operating System (OS)  takes care of the execution of C application. . Operating system would not involve and provide any kind of services in executing java application
Q). Responsibility of the JVM
Ans:- Apart from converting the byte code into its equivalent executable code ,JVM has many  other responsibility or we can say many work has been done  automatically . Since machine is something related to the physical entity , so in order to represent that it is not physically present  (imaginary) since the program is under execution  we termed it as a Virtual Machine. And this machine related to java technology so we called it as Java Virtual Machine (JVM ) .


Without using library function you cannot imagine to develop any program. Using library function is more  when we are developing the java application. When u compile then we get same no of function whatever u  mention in your source code of  java program ,so here the question arises that how we can use the library function which is not present in the byte code of the .class file which is present in the source file. Any middle language (byte code)  is highly optimized .We are asking jvm(Actually processor  )   to execute the byte code , jvm would not convert all the 100 functions byte code into its equivalent  executable code(Executable code is highly dynamic in java it will generate only when the function call is made) ,only the executable code of the main method is loaded to the RAM. JVM first searches and locate  the main method out of 100 method (previously it is done by OS) ,then it will allocate the memory in the RAM for only main method and ask processor to start the execution of the program which is present in such address  of the RAM accordingly the processor come to the particular place and loads the main method. All the addresses  maintains by the jvm (previously by OS).
Processor can execute any function which is present inside the RAM in the form of its executable code. When function call is made then the processor searches  it in the RAM  if this function is not found in the RAM the JVM searches it into the byte code  once its find that function in the byte code then it allocate the memory space in the RAM and loads the functionality and when the functionalities is completes then it is automatically garbage collected.
Once the execution of the function is completes then executable code from  the RAM is deleted and the control returns to the calling place , that’s why we cannot see  executable code of java due to highly dynamic.
 
Who loads jvm to RAM who makes the processor to start the jvm .
Ans: -OS
 A part of the RAM would be exclusively allocated for the JVM  for executing functionalities  is known as workarea  which is assigned by OS to JVM.
JVM divides into several area :
1).  Stack : local variable
2).  Heap: Objects
3). Partitions for the byte code (Allocating the memory space for byte code is not considered since it is not understandable by the processor)
àByte code loaded into the RAM only for the sake of RAM.
So for the processor byte code present in the RAM or byte code present in the HARD DISC is same  , since processor does not understand byte code.
Whenever function call  is  made complete  byte code is loaded into the RAM
Cache memory : small piece of the RAM for maintaining functionalities temporarily which is executed .when we made function call second time then control first searches in the cache memory if find that executable code of the function and loads into the work area , if not find then control again goes to the byte code and do the same procedure again. Once the control outs from the main method then it is going to delete all the executable code which is present in the cache and also it deletes the corresponding byte code from the workarea. In order to maintain byte code in workarea some program is available.



 
 

Is Malaysia Govt. hiding truth about MH370 flight ?

In the age of constant surveillance, it’s not supposed to be possible for an airliner with 239 people on board to simply vanish. The mystery of what happened to Malaysia Airlines Flight 370 has gripped the world. CNN has seen its ratings soar by broadcasting nonstop coverage of the missing airplane. Millions of people are scouring satellite images of the oceans looking for pieces of debris. There is endless water cooler conversation about the clues and speculation about the cause of the disappearance. Reuters columnist Jack Shafer speaks for many when he writes story has wedged its way into my consciousness and will persist until somebody locates the Boeing 777 and solves the mystery.
Why should the story of Flight 370 grip us so? This mystery seems almost designed to arouse some fundamental parts of our brain. One of our most essential tasks is to solve the enigma of the outside world, and this starts with our basic sensory perceptions. Our conscious minds experience reality as a seamlessly spooling movie in HD and surround sound. But our brain is fooling us. It turns out the very act of perception “is more like puzzle solving than most people realize,” writes neuroscientist V.S. Ramachandran in The Tell-Tale Brain. “When you look at a simple visual scene, your brain is constantly resolving ambiguities, testing hypotheses, searching for patterns, comparing current information with memories and expectations.”
Since our brains are in the business of solving the puzzle of reality, no wonder we are so gripped when reality presents us with such a maddening puzzle. (Even if the debris in the Indian Ocean is proven to be from the missing plane, we still haven't solved the mystery of what happened.) The few clues leave us endlessly speculating about what happened to the plane; in the same way, our brains must use the necessarily limited data our senses perceive and apply deductive skills to constantly come up with a functionally plausible version of reality. The study of illusion gives us a glimpse at the trickery our brains useto create, below our conscious awareness, our continuous sense of the world. Our brains are a kind of detective for our conscious mind.
Advertisement . But it’s the specific nature of the disappearance of Flight 370 that pings some of our most basic cognitive drives. In their book The Scientist in the Crib, Alison Gopnik, Andrew Meltzoff, and Patricia Kuhl write, “Babies become interested in, almost obsessed with, hiding-and-finding games when they are about a year old. There is the timeless appeal of peekaboo. … Babies also spontaneously undertake solo investigations of the mysterious Case of the Disappearing Object.” So, from our earliest days, we focus our attention on objects that are hidden, and then revealed. This consuming play, they write, “contributes to babies’ ability to solve the big, deep problems of disappearance, causality, and categorization.” No wonder we’re watching CNN’s nonstop coverage of a disappearing object.
We may be especially sensitive to seeing what’s hidden because for our ancestors discovering food and evading threats were crucial to survival. Ramachandran writes that our visual system “evolved to detect predators behind foliage.” Discovering hidden things is so central to our evolutionary survival that when we do so, “we get an internal ‘Aha!’ sensation.” This “zap of pleasure” comes about, he explains, because our visual centers are wired to our limbic reward system. Without the reward, he says, we’d give up too easily on difficult problems. This makes it easier to understand why all over the world people have an irresistible urge to scour satellite images of vast oceans, seeking the kick of being the one to point and say, “There it is!”

Malaysian prime minister, speaking at a press conference minutes ago, says that British investigators have concluded that Malaysia Airlines MH370 did indeed take the southern flight corridor over the Indian Ocean. This conclusion appears to be based on the same Inmarsat data from last week. “According to this new data, flight MH370 ended in the Indian Ocean,” prime minister Najib Razak said. Following this confirmation, Malaysia Airlines sent a text message to relatives, saying that “we have to assume beyond any reasonable doubt that MH370 has been lost and that none of those on board survived.”
As for what actually happened to flight MH370, we still don’t know. The southern Indian Ocean is one of the most remote parts of the world, making it an incredibly hard location to search. It is entirely possible that we will never find the flight data recorder (black box), and thus never find out what actually happened on board.
12:50 March 21: Bad news — so far, despite five aircraft being dispatched by Australia and the US, no debris of flight MH370 has been found. This is likely because the debris, which was spotted in satellite imagery from March 16, has since drifted a significant distance (hundreds of miles). So far the planes have been using radar to look for the debris, covering large swaths of ocean from a high altitude, but now the search will be visual — which involves the planes flying very low, and covering much less ground (and thus more aircraft are needed). Other nations are sending aircraft and ships to aid with the search.
In other news, upon further investigation of MH370′s cargo manifest, it appears that the plane was carrying a shipment of lithium-ion batteries. Though there’s really no reason to believe that these caused the disaster. Most authorities and investigators still believe that the plane was intentionally hijacked or sabotaged.
 07:10 March 20: There has possibly been a breakthrough in the search for flight MH370. Australian authorities say they’ve found what appears to be the debris of the plane in some satellite imagery (pictured below). The debris is located about 1,500 miles (2,500km) from Perth in the Indian Ocean, off the south-west corner of Australia, along the same arc provided by the Inmarsat pings (see previous update below). Unfortunately, though, the Royal Australian Air Force (RAAF) sent an airplane to investigate the area — and could not locate any debris. “RAAF P3 crew unable to locate debris. Cloud & rain limited visbility. Further aircraft to continue search for #MH370,” the Australian Maritime Safety Authority said in a tweet. Malaysian authorities haven’t said much on the matter, only that this is the only credible lead that we have, so of course it will be investigated fully.