<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RBS India De interview questions and answers - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/rbs-india-de-interview-questions-and-answers/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/rbs-india-de-interview-questions-and-answers/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Mon, 02 May 2022 06:18:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>RBS India De interview questions and answers - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/rbs-india-de-interview-questions-and-answers/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to connect to the Database from QTP ?</title>
		<link>https://www.wikitechy.com/interview-questions/qtp/how-to-connect-to-the-database-from-qtp/</link>
					<comments>https://www.wikitechy.com/interview-questions/qtp/how-to-connect-to-the-database-from-qtp/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 21 Jul 2021 14:28:40 +0000</pubDate>
				<category><![CDATA[QTP]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[adodb connection in qtp]]></category>
		<category><![CDATA[adodb connection in qtp for excelexcel connection in qtp]]></category>
		<category><![CDATA[AVEVA Software interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Ciber Global Solutions interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[CSG International interview questions and answers]]></category>
		<category><![CDATA[database automation testing using qtp]]></category>
		<category><![CDATA[database connection in qtp]]></category>
		<category><![CDATA[database connection in qtp using dsn]]></category>
		<category><![CDATA[database connection in qtp with sql server]]></category>
		<category><![CDATA[database connection using qtp]]></category>
		<category><![CDATA[database connectivity with uft]]></category>
		<category><![CDATA[database in qtp]]></category>
		<category><![CDATA[database testing using qtp]]></category>
		<category><![CDATA[db connection in qtp]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[execute statement in qtp]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[HealthAsyst Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[how to connect to database in qtp]]></category>
		<category><![CDATA[how to connect to oracle database using qtp]]></category>
		<category><![CDATA[how to connect to oracle database using uft]]></category>
		<category><![CDATA[how to connect to oracle sql developer using qtp]]></category>
		<category><![CDATA[how to connect to the database from qtp]]></category>
		<category><![CDATA[how to fetch data from database in qtp]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mindtree interview questions and answers]]></category>
		<category><![CDATA[Newt Global interview questions and answers]]></category>
		<category><![CDATA[option explicit in qtp]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[qtp database script examples]]></category>
		<category><![CDATA[qtp database testing]]></category>
		<category><![CDATA[qtp sql query]]></category>
		<category><![CDATA[R Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[recordset object in qtp]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[uft connect to sql server]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[ValueLabs interview questions and answers]]></category>
		<category><![CDATA[virtual object in qtp]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[working with database in qtp]]></category>
		<category><![CDATA[working with excel in qtp]]></category>
		<category><![CDATA[xchanging interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=1171</guid>

					<description><![CDATA[Answer : Create an ADODB connection object which is required step for connecting to database as below....]]></description>
										<content:encoded><![CDATA[<div class="TextHeading"></div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Create an ADODB connection object which is required step for connecting to database as below.</li>
</ul>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><strong><code id="code1" class="hljs javascript" data-lang=""><span class="nt"><span class="hljs-built_in">Set</span> objConnection = CreateObject(“ADODB.Connection“)</span></code></strong></pre>
</figure>
</div>
</div>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">Create Recordset object which is for getting a value from database.</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code id="code2" class="hljs javascript" data-lang=""><span class="nt"><span class="hljs-built_in"><strong>Set</strong></span><strong> objRecordSet = CreateObject(“ADODB.Recordset“)</strong></span></code></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<p>Authentication using Id, Password and details.</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>Provider: For SQL server database the provider is “sqloledb”</li>
<li>Server: Open the SQL Server in your machine and Right click on the required Database/ click on properties.</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/qtp/how-to-connect-to-the-database-from-qtp-1.png" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Click on “View connection Properties”</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/qtp/how-to-connect-to-the-database-from-qtp-2.png" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>User Name and Server details are required from this dialogue box</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/qtp/how-to-connect-to-the-database-from-qtp-3.png" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>objConnection.open “provider=sqloledb; Server=SDWA-160-PC; User Id=SDWA-160; Password=; Database=sample; Trusted_Connection=Yes”</li>
<li>Hence, Connection setup completed and ready for execution.</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Enter the required SQL query to be executed.</li>
<li>Execution of the query with the statement below.</li>
</ul>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><strong><code id="code3" class="hljs css" data-lang=""><span class="nt"><span class="hljs-tag">objRecordSet</span><span class="hljs-class">.open</span> <span class="hljs-tag">sqlQuery</span>, <span class="hljs-tag">objConnection</span></span></code></strong></pre>
</figure>
</div>
</div>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-markdown code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-markdown code-embed-code">set conn=Createobject (&quot;ADODB.Connection&quot;) <br/>Srvname=&quot;Driver={Microsoft ODBC for <br/>Oracle}:Server=DBserver,UID=Sa,Password=sa&quot; <br/>conn.open Srvname <br/>Set Rec = Create Object(&quot;ADODB.Recordset&quot;) <br/>SQL=&quot;select * from Users&quot; <br/>Rec.open SQL ,conn <br/>Username=Rec.fields(&quot;employee name&quot;) <br/>Msgbox Username</code></pre> </div>
<div class="Content">
<div class="hddn">
<ul>
<li style="text-align: justify;">The above mentioned sample script has been executed and the value from the database is retrieved.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/qtp/how-to-connect-to-the-database-from-qtp/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference between wait() and sleep() in java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/difference-between-wait-and-sleep-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/difference-between-wait-and-sleep-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Sat, 17 Jul 2021 08:21:15 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[compare the sleep() and wait() methods in java]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[difference between sleep and wait]]></category>
		<category><![CDATA[difference between sleep and wait in java with example]]></category>
		<category><![CDATA[difference between sleep and wait in selenium]]></category>
		<category><![CDATA[difference between sleep and yield]]></category>
		<category><![CDATA[difference between sleep(1000) and wait(1000)]]></category>
		<category><![CDATA[difference between wait and sleep]]></category>
		<category><![CDATA[difference between wait and sleep in java]]></category>
		<category><![CDATA[difference between wait sleep and join in java]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to use wait in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[infozech interview questions and answers]]></category>
		<category><![CDATA[java 8 thread sleep]]></category>
		<category><![CDATA[java wait example]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[thread sleep and wait]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[wait and sleep in java]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what happens if sleep() and wait() executes in synchronized block?]]></category>
		<category><![CDATA[what is difference between wait () and sleep () method?]]></category>
		<category><![CDATA[what is wait () in Java?]]></category>
		<category><![CDATA[what is yield () and sleep () in thread java]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[yield method in java]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=681</guid>

					<description><![CDATA[Answer : wait() Method of thread class goes in waiting state ...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="difference-between-wait-and-sleep-in-java" class="color-pink">Difference between <a href="https://forums.wikitechy.com/question/what-are-the-differences-between-wait-and-sleep/" target="_blank" rel="noopener">wait() and sleep()</a> in java ?</h2>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4206" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/difference-between-wait-and-sleep-in-java.png" alt="" width="850" height="475" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/difference-between-wait-and-sleep-in-java.png 850w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/difference-between-wait-and-sleep-in-java-300x168.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/difference-between-wait-and-sleep-in-java-768x429.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/difference-between-wait-and-sleep-in-java-390x218.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/difference-between-wait-and-sleep-in-java-820x458.png 820w" sizes="(max-width: 850px) 100vw, 850px" /></p>
</div>
</div>
<div class="table-responsive">
<table class="table-bordered table-striped table table-responsive">
<tbody>
<tr>
<th>Wait() Method</th>
<th>Sleep() Method</th>
</tr>
<tr>
<td class="text-leftalign">wait() Method of <a href="https://www.wikitechy.com/tutorials/java/java-thread" target="_blank" rel="noopener">thread</a> class goes in waiting state<br />
and it won’t come back automatically until<br />
we call the notify() or notifyAll().</td>
<td class="text-leftalign"><a href="https://www.wikitechy.com/tutorials/java/thread-sleep-java">sleep()</a> is a method which is used to pause the process for few seconds or the time we want too.</td>
</tr>
<tr>
<td class="text-leftalign">It is called on Object.</td>
<td class="text-leftalign">It is called on Threads.</td>
</tr>
<tr>
<td class="text-leftalign">It is an instant member of java.lang.Object class.</td>
<td class="text-leftalign">It is a static member of java.lang.Thread class.</td>
</tr>
<tr>
<td class="text-leftalign">wait() releases the lock or monitor.</td>
<td class="text-leftalign">sleep() doesn’t releases the lock or monitor while waiting.</td>
</tr>
<tr>
<td class="text-leftalign">wait() is used for inter-thread communication.</td>
<td class="text-leftalign">sleep() is used to introduce pause on execution, generally.</td>
</tr>
<tr>
<td class="text-leftalign">It must be called within the synchronized blocks.</td>
<td class="text-leftalign">It may be called from within or outside the synchronized block.</td>
</tr>
<tr>
<td class="text-leftalign">
<h3 id="wait-example">wait() Example</h3>
<pre> synchronized(LOCK)
   {  
      LOCK.wait(); // LOCK is not held
   }</pre>
</td>
<td class="text-leftalign">
<h3 id="sleep-example">sleep() Example</h3>
<pre>    synchronized(LOCK)
{  
     Thread.sleep(1000); // LOCK is held
}</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p><img decoding="async" class="alignnone wp-image-4207 size-full" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java.png" alt="" width="1920" height="1080" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java.png 1920w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java-300x169.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java-1024x576.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java-768x432.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java-1536x864.png 1536w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java-390x219.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java-820x461.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/sleep-and-wait-in-java-1180x664.png 1180w" sizes="(max-width: 1920px) 100vw, 1920px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/difference-between-wait-and-sleep-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference between ClassNotFoundException and NoClassDefFoundError in java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/difference-between-classnotfoundexception-and-noclassdeffounderror-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/difference-between-classnotfoundexception-and-noclassdeffounderror-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:41 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[class not found exception in eclipse]]></category>
		<category><![CDATA[class to java]]></category>
		<category><![CDATA[classnotfoundexception]]></category>
		<category><![CDATA[classnotfoundexception in java]]></category>
		<category><![CDATA[classnotfoundexception java]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[custom exception handling in java]]></category>
		<category><![CDATA[custom exception in java]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[difference between classnotfoundexception and noclassdeffounderror in java]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[infozech interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[no class def found error]]></category>
		<category><![CDATA[no class def found error java]]></category>
		<category><![CDATA[noclassdeffounderror]]></category>
		<category><![CDATA[noclassdeffounderror in java]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[runtimeexception]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is error in java]]></category>
		<category><![CDATA[what is exception handling]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=670</guid>

					<description><![CDATA[Answer : ClassNotFoundException and NoClassDefFoundError occur when a particular...]]></description>
										<content:encoded><![CDATA[<div class="row">
<div class="col-sm-12">
<div class="TextHeading">
<div class="hddn">
<h2 id="difference-between-classnotfoundexception-and-noclassdeffounderror-in-java" class="color-pink" style="text-align: justify;">Difference between ClassNotFoundException and NoClassDefFoundError in java ?</h2>
<p><img decoding="async" class="alignnone size-full wp-image-4209" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/classnotfoundexception-vs-noclassdeffounderror.gif" alt="" width="920" height="709" /></p>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>ClassNotFoundException and NoClassDefFoundError occur when a particular class is not found at runtime. However, they occur at different scenarios.</li>
<li>ClassNotFoundException is an exception that occurs when you try to load a class at run time using <a href="https://www.wikitechy.com/tutorials/java/jdbc-resultset" target="_blank" rel="noopener">Class.forName()</a> or loadClass() methods and mentioned classes are not found in the classpath.</li>
<li>NoClassDefFoundError is an error that occurs when a particular class is present at compile time, but was missing at run time.</li>
</ul>
</div>
</div>
</div>
</div>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"></div>
</div>
</div>
<div class="table-responsive">
<table class="table-bordered table-striped table table-responsive">
<tbody>
<tr style="text-align: justify;">
<th>NoClassDefFoundError</th>
<th>ClassNotFoundException</th>
</tr>
<tr style="text-align: justify;">
<td class="text-leftalign">NoClassDefFoundError is an error. It is the type of<br />
java.lang.Error.</td>
<td class="text-leftalign">ClassNotFoundException is an exception. It is the type of java.lang.Exception.</td>
</tr>
<tr style="text-align: justify;">
<td class="text-leftalign">It occurs when java runtime system doesn’t<br />
find a class definition, which is present at compile time,<br />
but missing at run time.</td>
<td class="text-leftalign">It occurs when an application tries to load a class at run time which is not updated in the classpath.</td>
</tr>
<tr style="text-align: justify;">
<td class="text-leftalign">It is thrown by the Java Runtime System.</td>
<td class="text-leftalign">It is thrown by the application itself. It is thrown by the methods like Class.forName(), loadClass() and findSystemClass().</td>
</tr>
<tr>
<td class="text-leftalign" style="text-align: justify;">It occurs when required class definition is missing<br />
at runtime.</td>
<td class="text-leftalign" style="text-align: justify;">It occurs when classpath is not updated wih required JAR files.</td>
</tr>
</tbody>
</table>
</div>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4212" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling.jpg" alt="" width="1366" height="724" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling.jpg 1366w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling-300x159.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling-1024x543.jpg 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling-768x407.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling-390x207.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling-820x435.jpg 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/java-exception-handling-1180x625.jpg 1180w" sizes="(max-width: 1366px) 100vw, 1366px" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/difference-between-classnotfoundexception-and-noclassdeffounderror-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference between JDK JRE and JVM ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/difference-between-jdk-jre-and-jvm/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/difference-between-jdk-jre-and-jvm/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:36 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[difference between compiler and interpreter in tabular form]]></category>
		<category><![CDATA[difference between j2se and j2ee]]></category>
		<category><![CDATA[difference between java and core java]]></category>
		<category><![CDATA[difference between java and j2ee]]></category>
		<category><![CDATA[difference between java and java ee]]></category>
		<category><![CDATA[difference between java se and ee]]></category>
		<category><![CDATA[difference between java se and java ee]]></category>
		<category><![CDATA[difference between jdk and jre]]></category>
		<category><![CDATA[difference between jdk and jvm]]></category>
		<category><![CDATA[difference between jdk jre and jvm]]></category>
		<category><![CDATA[difference between jvm and jre]]></category>
		<category><![CDATA[difference between jvm jdk and jre]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[infozech interview questions and answers]]></category>
		<category><![CDATA[java development kit]]></category>
		<category><![CDATA[java difference]]></category>
		<category><![CDATA[java jdk]]></category>
		<category><![CDATA[java jre]]></category>
		<category><![CDATA[java set difference]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[jdk jre difference]]></category>
		<category><![CDATA[jre]]></category>
		<category><![CDATA[jre java]]></category>
		<category><![CDATA[jvm in java]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is the difference between jdk and jre]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=669</guid>

					<description><![CDATA[Answer : Java Development Kit is the core component...
]]></description>
										<content:encoded><![CDATA[<div class="row">
<div class="col-sm-12">
<div class="TextHeading">
<div class="hddn">
<h2 id="difference-between-jdk-jre-and-jvm" class="color-pink" style="text-align: justify;">Difference between JDK JRE and JVM ?</h2>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="jdk" class="color-green">JDK</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li><a href="https://www.wikitechy.com/tutorials/java/" target="_blank" rel="noopener">Java</a> Development Kit is the core component of Java Environment and provides all the tools, executables and binaries required to compile, debug and execute a Java Program.</li>
<li>JDK is a platform specific software and thats why we have separate installers for Windows, Mac and Unix systems.</li>
<li>We can say that JDK is superset of JRE since it contains JRE with Java compiler, debugger and core classes. Current version of JDK is 1.7 also known as <b>Java 7</b>.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4216" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm.jpg" alt="" width="1859" height="1049" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm.jpg 1859w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm-300x169.jpg 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm-1024x578.jpg 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm-768x433.jpg 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm-1536x867.jpg 1536w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm-390x220.jpg 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm-820x463.jpg 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/understand-jdk-jre-jvm-1180x666.jpg 1180w" sizes="(max-width: 1859px) 100vw, 1859px" /></div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="jvm" class="color-purple">JVM</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>JVM is the heart of <a href="https://www.wikitechy.com/tutorials/java/java-programming" target="_blank" rel="noopener">java programming language</a>. When we run a program, JVM is responsible to converting Byte code to the machine specific code.</li>
<li>JVM is also stage dependent and provides core java functions like memory management, garbage collection, security etc.</li>
<li>JVM is customizable and we can use java options to modify it, for example allocating minimum and maximum memory to JVM. JVM is called virtual because it delivers a interface that does not depend on the underlying operating system and machine hardware.</li>
<li>This independence from hardware and operating system is what makes java program write-once run-anywhere.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4214" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm.png" alt="" width="902" height="731" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm.png 902w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-300x243.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-768x622.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-390x316.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-820x665.png 820w" sizes="(max-width: 902px) 100vw, 902px" /></p>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="jre" class="color-blue">JRE</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>JRE is the implementation of JVM, it provides platform to execute java programs. JRE consists of JVM and java binaries and other classes to execute any program successfully.</li>
<li>JRE doesn’t contain any development tools like java compiler, debugger etc.</li>
<li>If you want to execute any java program, you should have JRE installed but we don’t need JDK for running any java program.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4215 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-jre-jdk.png" alt="" width="452" height="462" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-jre-jdk.png 452w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-jre-jdk-294x300.png 294w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/jvm-jre-jdk-390x399.png 390w" sizes="(max-width: 452px) 100vw, 452px" /></p>
</div>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table-bordered table-striped table table-responsive">
<tbody>
<tr style="text-align: justify;">
<th>JDK</th>
<th>JRE</th>
<th>JVM</th>
</tr>
<tr style="text-align: justify;">
<td class="text-leftalign">Java Development Kit</td>
<td class="text-leftalign">Java Runtime environment.</td>
<td class="text-leftalign">Java Virtual Machine.</td>
</tr>
<tr style="text-align: justify;">
<td class="text-leftalign">Kit providing the platform to develop<br />
and execute/run the java program.</td>
<td class="text-leftalign">It is an installation package<br />
which provides environment to only<br />
run(not develop) the java program<br />
(or application)onto your machine.</td>
<td class="text-leftalign">Whatever Java program you run using JRE or JDK goes into JVM and JVM is responsible for executing the java program<br />
line by line hence it is also known as interpreter.</td>
</tr>
<tr>
<td class="text-leftalign" style="text-align: justify;">JDK is only used by<br />
Java Developers.</td>
<td class="text-leftalign" style="text-align: justify;">JRE is only used by them who<br />
only wants to run the Java Programs<br />
(i.e). end users of your system.</td>
<td class="text-leftalign" style="text-align: justify;">It is in-built in both JDK and JRE.</td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/difference-between-jdk-jre-and-jvm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Java program to find second largest number in an array ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/java-program-to-find-second-largest-number-in-an-array/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/java-program-to-find-second-largest-number-in-an-array/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:30 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[find largest and smallest number in an array in java]]></category>
		<category><![CDATA[find largest number in array in java]]></category>
		<category><![CDATA[find largest number in array java]]></category>
		<category><![CDATA[find largest number in java]]></category>
		<category><![CDATA[find second largest number in array in java0]]></category>
		<category><![CDATA[find the largest number in an array in java]]></category>
		<category><![CDATA[find the largest number in an array javascript]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to find largest and smallest number in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java code to find second largest number in an array]]></category>
		<category><![CDATA[java find largest number in list]]></category>
		<category><![CDATA[java largest int]]></category>
		<category><![CDATA[java program for largest of three numbers]]></category>
		<category><![CDATA[java program to find largest of three numbers]]></category>
		<category><![CDATA[java program to find largest of two numbers]]></category>
		<category><![CDATA[java program to find second largest number in an array]]></category>
		<category><![CDATA[java program to find second largest number of array]]></category>
		<category><![CDATA[java program to find the largest number in an array]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[largest and smallest java program]]></category>
		<category><![CDATA[largest number in java]]></category>
		<category><![CDATA[largest of 3 numbers in java]]></category>
		<category><![CDATA[largest of 4 numbers using conditional operator in java]]></category>
		<category><![CDATA[MagicBricks Interview Questions and Answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=668</guid>

					<description><![CDATA[Answer : Given an array of integers, our task is to write a program...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="java-program-to-find-second-largest-number-in-an-array" class="color-pink" style="text-align: justify;">Java program to find second largest number in an array ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Given an <a href="https://www.wikitechy.com/technology/find-closest-pair-two-sorted-arrays/" target="_blank" rel="noopener">array</a> of integers, our task is to write a program that efficiently finds the second <a href="https://www.wikitechy.com/technology/c-programming-kth-smallestlargest-element-unsorted-array-expected-linear-time-2/" target="_blank" rel="noopener">largest element</a> present in the array.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="algorithm" class="color-red">Algorithm:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Initialize two variables first and second to INT_MIN as,
<ul>
<li>first = second = INT_MIN</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>Start <a href="https://www.wikitechy.com/technology/c-programming-tree-traversals-inorder-preorder-postorder/" target="_blank" rel="noopener">traversing the array</a>,</li>
</ul>
</li>
</ul>
<p>a) If the current element in array say arr[i] is greater than first. Then update first and second as,</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>second = first</li>
<li>first = arr[i]</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>b) If the current element is in between first and second, then update second to store the value of current variable as</p>
<li style="list-style-type: none;">
<ul>
<li>second = arr[i]</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Return the value stored in second.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="step-1" class="color-blue">step 1</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Iterate the given array.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="step-2-first-if-condition-arri-largest" class="color-blue">Step 2 (first if condition arr[i] &gt; largest):</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>If current array value is greater than largest value then move the largest value to <a href="https://www.wikitechy.com/interview-questions/data-structure/how-to-find-second-largest-element-in-bst/" target="_blank" rel="noopener">secondLargest</a> and make current value as largest</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="step-3-second-if-condition-arri-secondlargest" class="color-blue">Step 3 (second if condition arr[i] &gt;secondLargest )</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>If the current value is smaller than largest and greater than secondLargest then the current value becomes secondLargest.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-red" style="text-align: justify;">Sample code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">public class SecondLargest {<br/>     <br/>    	public static void main(String[] args) {<br/>     <br/>    		int arr[] = { 24, 56, 57, 105, 102, 62, 58, 46, 76, 95 };<br/>    		int largest = arr[0];<br/>    		int secondLargest = arr[0];<br/>    		<br/>    		System.out.println(&quot;The given array is:&quot; );<br/>    		for (int i = 0; i &lt; arr.length; i++) {<br/>    			System.out.print(arr[i]+&quot;\t&quot;);<br/>    		}<br/>    		for (int i = 0; i &lt; arr.length; i++) {<br/>     <br/>    			if (arr[i] &gt; largest) {<br/>    				secondLargest = largest;<br/>    				largest = arr[i];<br/>     <br/>    			} else if (arr[i] &gt; secondLargest) {<br/>    				secondLargest = arr[i];<br/>     <br/>    			}<br/>    		}<br/>     <br/>    		System.out.println(&quot;\nSecond largest number is:&quot; + secondLargest);<br/>     <br/>    	}<br/>    }</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-red">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs css" data-lang=""><span class="nt"><span class="hljs-tag">The</span> <span class="hljs-tag">given</span> <span class="hljs-tag">array</span> <span class="hljs-tag">is</span>:
24	56	57	105	 102  62  58  46  76  95	
<span class="hljs-tag">Second</span> <span class="hljs-tag">largest</span> <span class="hljs-tag">number</span> <span class="hljs-tag">is</span><span class="hljs-pseudo">:102</span></span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/java-program-to-find-second-largest-number-in-an-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Java Program to reverse a Linked List ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/java-program-to-reverse-a-linked-list/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/java-program-to-reverse-a-linked-list/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:25 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[circular linked list java]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[compro technologies interview questions and answers]]></category>
		<category><![CDATA[create linked list java]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[doubly linked list java]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to implement linked list in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[javascript linked list]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[linked list class in java]]></category>
		<category><![CDATA[linked list data structure in java]]></category>
		<category><![CDATA[linked list implementation in java]]></category>
		<category><![CDATA[linked list implementation in java source code]]></category>
		<category><![CDATA[linked list java code]]></category>
		<category><![CDATA[linked list java tutorial]]></category>
		<category><![CDATA[linked list program in java]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[reverse linked list java]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[singly linked list java]]></category>
		<category><![CDATA[sort linked list java]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=666</guid>

					<description><![CDATA[Answer : A Linked list contains two things data and the address of the node each node....]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="java-program-to-reverse-a-linked-list" class="color-pink" style="text-align: justify;">Java Program to reverse a Linked List ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>A <a href="https://www.wikitechy.com/technology/quicksort-doubly-linked-list-2/" target="_blank" rel="noopener">Linked list</a> contains two things data and the address of the node each node is linked to the next node.</li>
<li>There can be two solution to reverse a linked list in java.
<ul>
<li><a href="https://www.wikitechy.com/technology/iterative-quick-sort/" target="_blank" rel="noopener">Iterative</a></li>
<li><a href="https://www.wikitechy.com/technology/c-algorithm-write-recursive-function-print-reverse-linked-list/" target="_blank" rel="noopener">Recursive</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="iterative" class="color-purple">Iterative</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Here we have three nodes i.e previousNode, currentNode and nextNode</li>
<li>When currentNode is starting node, then previousNode will be null</li>
<li>Assign currentNode.next to previousNode to reverse the link.</li>
<li>In each iteration move currentNode and previousNode by 1 node.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"></div>
</div>
</div>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/java/iterative-method-linked-list.gif" alt=" data- linked-list" /></div>
<div>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">public static Node reverseLinkedList(Node currentNode)<br/>	{<br/>		// For first node, previousNode will be null<br/>		Node previousNode=null;<br/>		Node nextNode;<br/>		while(currentNode!=null)<br/>		{<br/>			nextNode=currentNode.next;<br/>			// reversing the link<br/>			currentNode.next=previousNode;<br/>			// moving currentNode and previousNode by 1 node<br/>			previousNode=currentNode;<br/>			currentNode=nextNode;<br/>		}<br/>		return previousNode;<br/>	}</code></pre> </div>
<h2 id="sample-code-in-java" class="color-pink" style="text-align: justify;">Sample Code in Java:</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">public class LinkedList{<br/> <br/>	private Node head;<br/> <br/>	private static class Node {<br/>		private int value;<br/>		private Node next;<br/> <br/>		Node(int value) {<br/>			this.value = value;<br/> <br/>		}<br/>	}<br/> <br/>	public void addToTheLast(Node node) {<br/> <br/>		if (head == null) {<br/>			head = node;<br/>		} else {<br/>			Node temp = head;<br/>			while (temp.next != null)<br/>				temp = temp.next;<br/> <br/>			temp.next = node;<br/>		}<br/>	}<br/> <br/> <br/>	public void printList(Node head) {<br/>		Node temp = head;<br/>		while (temp != null) {<br/>			System.out.format(&quot;%d &quot;, temp.value);<br/>			temp = temp.next;<br/>		}<br/>		System.out.println();<br/>	}<br/> <br/>	// Reverse linkedlist using this function <br/>	public static Node reverseLinkedList(Node currentNode)<br/>	{<br/>		// For first node, previousNode will be null<br/>		Node previousNode=null;<br/>		Node nextNode;<br/>		while(currentNode!=null)<br/>		{<br/>			nextNode=currentNode.next;<br/>			// reversing the link<br/>			currentNode.next=previousNode;<br/>			// moving currentNode and previousNode by 1 node<br/>			previousNode=currentNode;<br/>			currentNode=nextNode;<br/>		}<br/>		return previousNode;<br/>	}<br/> <br/>	public static void main(String[] args) {<br/>		LinkedList list = new LinkedList();<br/>		// Creating a linked list<br/>		Node head=new Node(5);<br/>		list.addToTheLast(head);<br/>		list.addToTheLast(new Node(6));<br/>		list.addToTheLast(new Node(7));<br/>		list.addToTheLast(new Node(1));<br/>		list.addToTheLast(new Node(2));<br/> <br/>		list.printList(head);<br/>		//Reversing LinkedList<br/>		Node reverseHead=reverseLinkedList(head);<br/>		System.out.println(&quot;After reversing&quot;);<br/>		list.printList(reverseHead);<br/> <br/>	}<br/> <br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-pink">Output :</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs" data-lang=""><span class="nt">5 6 7 1 2 
After reversing
2 1 7 6 5</span></code></pre>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="recursive-method" class="color-purple">Recursive Method:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Divide the list in two parts &#8211; first node and rest of the linked list.</li>
<li>Call reverse for the rest of the linked list.</li>
<li>Link rest to first.</li>
<li>Fix head pointer</li>
</ul>
</div>
</div>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/java/reverse-linked-list-in-java.jpg" alt=" data- linked-list" /></div>
</div>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/java-program-to-reverse-a-linked-list/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Why do we need garbage collection ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/why-do-we-need-garbage-collection/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/why-do-we-need-garbage-collection/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:15 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[compro technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[g1 garbage collector]]></category>
		<category><![CDATA[garbage collection algorithms for equal sized blocks]]></category>
		<category><![CDATA[garbage collection algorithms in java]]></category>
		<category><![CDATA[garbage collection algorithms in java 8]]></category>
		<category><![CDATA[garbage collection algorithms mark and sweep]]></category>
		<category><![CDATA[garbage collection in java]]></category>
		<category><![CDATA[garbage collection in java 8]]></category>
		<category><![CDATA[garbage collection in java 8 example]]></category>
		<category><![CDATA[garbage collection in java interview questions]]></category>
		<category><![CDATA[garbage collectors in jdk 6 includes]]></category>
		<category><![CDATA[how garbage collection works in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java 7 garbage collection]]></category>
		<category><![CDATA[java garbage collection tuning]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is the purpose of garbage collection in java and when is it used]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=665</guid>

					<description><![CDATA[Answer : Java garbage collection is the method by which Java programs ....]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="why-do-we-need-garbage-collection" class="color-pink" style="text-align: justify;">Why do we need garbage collection ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Java garbage collection is the method by which Java programs achieve automatic <a href="https://www.wikitechy.com/tutorials/c++/c++-memory-management" target="_blank" rel="noopener">memory management</a>.</li>
<li>Java programs compile to bytecode which will be run on a Java Virtual Machine.</li>
<li>Once java programs run on the JVM, objects are created on the <a href="https://www.wikitechy.com/technology/time-complexity-building-heap-2/" target="_blank" rel="noopener">heap</a>, which is a portion of memory dedicated to the program. Finally, some objects cannot be required.</li>
<li>The garbage collector finds these unused objects and deletes them to free up memory.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="how-java-garbage-collection-works" class="color-blue">How Java Garbage Collection Works</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Java garbage collection is an automatic process.</li>
<li>The programmer does not need to explicitly mark objects to be deleted. The garbage collection implementation lives in the JVM. Every JVM will implement garbage collection however it satisfies the only requirement is that it meets the JVM specification.</li>
<li>Although there are many JVMs, Oracle’s HotSpot is the most common. It offers a robust and complete set of garbage collection options.</li>
<li>While HotSpot has multiple garbage collectors that are optimized for various use cases, all its garbage collectors follow the same basic process.
<ul>
<li>In the first step, unreferenced objects are identified and marked as ready for garbage collection.</li>
<li>In the second step, marked objects are deleted.</li>
<li>Optionally, memory can be compacted after the garbage collector deletes objects, so remaining objects are in a contiguous block at the start of the heap. The compaction process makes it easier to allocate memory to new objects sequentially after the block of memory allocated to existing objects.</li>
</ul>
</li>
<li>All of HotSpot’s garbage collectors implement a generational garbage collection strategy that categorizes objects by age. The rationale behind generational garbage collection is that most objects are short-lived and will be ready for garbage collection soon after creation.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"></div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block" src="https://cdn.wikitechy.com/interview-questions/java/garbage-collection-in-java.png" alt=" garbage" /></div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="the-heap-is-divided-into-three-sections">The heap is divided into three sections:</h2>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="young-generation" class="color-pink">Young Generation</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Newly created objects start in the Young Generation. The Young Generation is further subdivided into an Eden space, where all new objects start, and two Survivor spaces, where objects are moved from Eden after surviving one garbage collection cycle.</li>
<li>When objects are garbage collected from the Young Generation, it is a minor garbage collection event.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="old-generation" class="color-pink">Old Generation:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li><a href="https://www.wikitechy.com/tutorials/c++/c++-object" target="_blank" rel="noopener">Objects</a> that are long-lived are ultimately moved from the Young Generation to the Old Generation. When objects are garbage collected from the Old Generation, it is a major garbage collection event.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="permanent-generation" class="color-pink">Permanent Generation:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li><a href="https://www.wikitechy.com/interview-questions/pentaho/what-is-the-importance-of-metadata-in-pentaho/" target="_blank" rel="noopener">Metadata</a> classes and methods are stored in the Permanent Generation. Classes that are no longer in use may be garbage collected from the Permanent Generation.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4219 aligncenter" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works.png" alt="" width="1490" height="808" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works.png 1490w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works-300x163.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works-1024x555.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works-768x416.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works-390x211.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works-820x445.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/how-garbage-collector-works-1180x640.png 1180w" sizes="(max-width: 1490px) 100vw, 1490px" /></p>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="needs-of-java-garbage-collection" class="color-green">Needs of Java Garbage Collection</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li style="text-align: justify;">The benefit of Java garbage collection is that it automatically handles the deletion of unused objects or objects that are out of reach to free up memory resources.</li>
<li style="text-align: justify;">Programmers working in languages without garbage collection (like <a href="https://www.wikitechy.com/tutorials/c-programming/" target="_blank" rel="noopener">C</a> and <a href="https://www.wikitechy.com/tutorials/c++/">C++</a>) must implement manual memory management in their code.</li>
<li style="text-align: justify;">Some programmers maintain in favor of manual memory management over garbage collection, primarily for reasons of control and performance.</li>
<li style="text-align: justify;">While the discussion over memory management approaches continues to rage on, garbage collection is now a standard component of many popular programming languages.</li>
<li style="text-align: justify;">For situations in which the garbage collector is negatively impacting performance, Java offers several options for tuning the garbage collector to improve its efficiency.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/why-do-we-need-garbage-collection/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Find number of occurrence of each of the unique characters in a string ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/find-number-of-occurrence-of-each-of-the-unique-characters-in-a-string/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/find-number-of-occurrence-of-each-of-the-unique-characters-in-a-string/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:09 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[charat java]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[compro technologies interview questions and answers]]></category>
		<category><![CDATA[count occurrences of character in string java using hashmap]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to count characters in string array in java]]></category>
		<category><![CDATA[how to count occurrence of a given character in a string in c]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java counter]]></category>
		<category><![CDATA[java replace]]></category>
		<category><![CDATA[java string]]></category>
		<category><![CDATA[java string compare]]></category>
		<category><![CDATA[java string contains]]></category>
		<category><![CDATA[java string length]]></category>
		<category><![CDATA[java string replace]]></category>
		<category><![CDATA[java trim]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[occurrence of each character in string java]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[program to find occurrence of a character in a string in java]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[string class in java]]></category>
		<category><![CDATA[string class methods in java]]></category>
		<category><![CDATA[string count]]></category>
		<category><![CDATA[substring java]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=664</guid>

					<description><![CDATA[Answer : In this program an approach using Hashmap....]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="find-number-of-occurrence-of-each-of-the-unique-characters-in-a-string" class="color-pink" style="text-align: justify;">Find number of occurrence of each of the unique characters in a string ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>In this program an approach using <a href="https://www.wikitechy.com/tutorials/java/java-linked-hashmap" target="_blank" rel="noopener">Hashmap</a> in Java.
<ul>
<li>Declare a Hashmap in Java of {char, int}.</li>
<li>Traverse in the string, check if the Hashmap already contains the traversed character or not.</li>
<li>If it is present, then increase its count using <a href="https://www.wikitechy.com/tutorials/python/get-method-for-dictionaries-in-python" target="_blank" rel="noopener">get()</a> and put() function in Hashmap.</li>
<li>Once the traversal is completed, traverse in the Hashmap and print the character and its frequency.</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="example" class="color-purple">Example</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">Input: str = &quot;Wikitechy&quot;<br/>Output: <br/>        W 1<br/>        i 2<br/>        k 1<br/>        t 1<br/>        e 1<br/>        c 1<br/>        h 1<br/>        y 1</code></pre> </div>
<h2 id="sample-code-in-java" class="color-blue">Sample Code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">// Java prorgam to count frequencies of <br/>// characters in string using Hashmap <br/>import java.io.*; <br/>import java.util.*; <br/>class OccurenceOfCharInString { <br/>	static void characterCount(String inputString) <br/>	{ <br/>		// Creating a HashMap containing char <br/>		// as a key and occurrences as a value <br/>		HashMap&lt;Character, Integer&gt; charCountMap = new HashMap&lt;Character, Integer&gt;(); <br/><br/>		// Converting given string to char array <br/><br/>		char[] strArray = inputString.toCharArray(); <br/><br/>		// checking each char of strArray <br/>		for (char c : strArray) { <br/>			if (charCountMap.containsKey(c)) { <br/><br/>				// If char is present in charCountMap, <br/>				// incrementing it&#039;s count by 1 <br/>				charCountMap.put(c, charCountMap.get(c) + 1); <br/>			} <br/>			else { <br/><br/>				// If char is not present in charCountMap, <br/>				// putting this char to charCountMap with 1 as it&#039;s value <br/>				charCountMap.put(c, 1); <br/>			} <br/>		} <br/><br/>		// Printing the charCountMap <br/>		for (Map.Entry entry : charCountMap.entrySet()) { <br/>			System.out.println(entry.getKey() + &quot; &quot; + entry.getValue()); <br/>		} <br/>	} <br/><br/>	// Driver Code <br/>	public static void main(String[] args) <br/>	{ <br/>		String str = &quot;Wikitechy&quot;; <br/>		characterCount(str); <br/>	} <br/>} </code></pre> </div>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">Output<br/>c 1<br/>t 1<br/>e 1<br/>W 1<br/>h 1<br/>i 2<br/>y 1<br/>k 1</code></pre> </div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/find-number-of-occurrence-of-each-of-the-unique-characters-in-a-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to optimally divide an array into two subarrays so that sum of elements in both are same ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:03:02 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[2d array java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[addition program in java]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[array declaration]]></category>
		<category><![CDATA[array declaration in java]]></category>
		<category><![CDATA[array of objects in java]]></category>
		<category><![CDATA[array programs in java]]></category>
		<category><![CDATA[arraylist java]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[for each loop java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java 8 reduce]]></category>
		<category><![CDATA[java add to array]]></category>
		<category><![CDATA[java array]]></category>
		<category><![CDATA[java array class]]></category>
		<category><![CDATA[java array example]]></category>
		<category><![CDATA[java array length]]></category>
		<category><![CDATA[java array methods]]></category>
		<category><![CDATA[java foreach array]]></category>
		<category><![CDATA[java initialize array]]></category>
		<category><![CDATA[java print array]]></category>
		<category><![CDATA[java sort array]]></category>
		<category><![CDATA[java stream sum]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[remaxys infotech interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[split array where sum of left hand side is equal to sum of right hand side]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=663</guid>

					<description><![CDATA[Answer : Given an array of integers greater than zero...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same" class="color-pink" style="text-align: justify;">How to optimally divide an array into two subarrays so that sum of elements in both are same ?</h2>
<p style="text-align: justify;">There are two methods used to <a href="https://www.wikitechy.com/tutorials/java/how-to-split-string-into-array-in-java" target="_blank" rel="noopener">split arrays</a>,</p>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Given an array of integers greater than zero, find if it is possible to split it in two subarrays (without reordering the elements), such that the sum of the two subarrays is the same. For example,</li>
</ul>
</div>
</div>
<div class="Output" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs" data-lang=""><span class="nt">Input : Arr[] = { 1 , 2 , 3 , 4 , 5 , 5  }
Output :  { 1 2 3 4 } 
          { 5 , 5 }
</span></code></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Given an array of integers, find if it’s possible to remove exactly one integer from the array that divides the array into two subarrays with the same sum. For Example,</li>
</ul>
</div>
</div>
<div class="Output" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs bash" data-lang=""><span class="nt">                           Input:  arr = [<span class="hljs-number">6</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">2</span>, <span class="hljs-number">1</span>]
                           Output:  <span class="hljs-literal">true</span>
</span></code></pre>
</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>On removing element 2 at index 1, the array gets divided into two subarrays [6] and [3, 2, 1] having equal sum.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"></div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-blue" style="text-align: justify;">Sample Code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">/ Java program to split an array <br/>// into two equal sum subarrays <br/>import java.io.*;<br/><br/>class Wikitechy {<br/><br/>    // Returns split point. If <br/>    // not possible, then return -1. <br/>    static int findSplitPoint(int arr[], int n) {<br/><br/>        int leftSum = 0;<br/><br/>        // traverse array element <br/>        for (int i = 0; i &lt; n; i++) {<br/>            // add current element to left Sum <br/>            leftSum += arr[i];<br/><br/>            // find sum of rest array <br/>            // elements (rightSum) <br/>            int rightSum = 0;<br/><br/>            for (int j = i + 1; j &lt; n; j++)<br/>                rightSum += arr[j];<br/><br/>            // split point index <br/>            if (leftSum == rightSum)<br/>                return i + 1;<br/>        }<br/><br/>        // if it is not possible to <br/>        // split array into two parts <br/>        return -1;<br/>    }<br/><br/>    // Prints two parts after finding <br/>    // split point using findSplitPoint() <br/>    static void printTwoParts(int arr[], int n) {<br/><br/>        int splitPoint = findSplitPoint(arr, n);<br/><br/>        if (splitPoint == -1 || splitPoint == n) {<br/>            System.out.println(&quot;Not Possible&quot;);<br/>            return;<br/>        }<br/><br/>        for (int i = 0; i &lt; n; i++) {<br/>            if (splitPoint == i)<br/>                System.out.println();<br/><br/>            System.out.print(arr[i] + &quot; &quot;);<br/><br/>        }<br/>    }<br/><br/>    // Driver program <br/><br/>    public static void main(String[] args) {<br/><br/>        int arr[] = {1,1,0,2};<br/>        int n = arr.length;<br/>        printTwoParts(arr, n);<br/><br/>    }<br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs" data-lang=""><span class="nt">1 1 
0 2</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-optimally-divide-an-array-into-two-subarrays-so-that-sum-of-elements-in-both-are-same/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to check if a string contains the sequences of characters or not using java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-check-if-a-string-contains-the-sequences-of-characters-or-not-using-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-check-if-a-string-contains-the-sequences-of-characters-or-not-using-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:02:56 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[best string library]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[check a string contains the sequences of characters]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java string contains]]></category>
		<category><![CDATA[javacompare strings]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[remaxys infotech interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[string class methods]]></category>
		<category><![CDATA[string functions]]></category>
		<category><![CDATA[string functions in java with examples]]></category>
		<category><![CDATA[string library]]></category>
		<category><![CDATA[string manipulation]]></category>
		<category><![CDATA[string match]]></category>
		<category><![CDATA[string methods]]></category>
		<category><![CDATA[string split]]></category>
		<category><![CDATA[strings substring]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=662</guid>

					<description><![CDATA[Answer : java.lang.String.contains() method searches the sequence of characters...
]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-check-if-a-string-contains-the-sequences-of-characters-or-not-using-java" class="color-pink">How to check if a string contains the sequences of characters or not using java ?</h2>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="contain-method" class="color-blue">Contain() Method</h2>
</div>
</div>
<ul>
<li><b>java.lang.String.contains()</b> method searches the sequence of characters in the given string. If sequence of char values are found in this string then print <b>Yes</b> otherwise print <b>No</b>.</li>
</ul>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-blue">Sample Code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">/ Java program to demonstrate working <br/>// contains() method <br/>public class Wikitechy {<br/><br/>    // Driver code <br/>    public static void main(String args[]) {<br/>        String s1 = &quot;Welcome to Wikitechy&quot;;<br/>        if (s1.contains(&quot;kite&quot;) == true) {<br/>            System.out.println(&quot;Yes&quot;);<br/>        }<br/>        // prints true <br/>        else {<br/>            System.out.println(&quot;No&quot;);<br/>        }<br/>    }<br/>}</code></pre> </div>
<div class="TextHeading">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs" data-lang=""><span class="nt">Yes</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-check-if-a-string-contains-the-sequences-of-characters-or-not-using-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to find next greater element for every element in an array ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-find-next-greater-element-for-every-element-in-an-array/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-find-next-greater-element-for-every-element-in-an-array/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Wed, 14 Jul 2021 00:02:50 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[c program to replace every element with the next greatest element]]></category>
		<category><![CDATA[c++ program to replace an element in an array]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[find next greater number in array]]></category>
		<category><![CDATA[find next greater number with same set of digits leetcode]]></category>
		<category><![CDATA[find next greater number with same set of digits python]]></category>
		<category><![CDATA[find next smaller number with same set of digits]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[infrrd interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[next greater element in array java]]></category>
		<category><![CDATA[next greater number - same digits in c]]></category>
		<category><![CDATA[next greater permutation in c]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[replace every element with the greatest element on right side in c++]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=661</guid>

					<description><![CDATA[Answer : In an array, to display the Next Greater Element (NGE)...
]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-find-next-greater-element-for-every-element-in-an-array" class="color-pink" style="text-align: justify;">How to find next greater element for every element in an array ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>In an array, to display the Next Greater Element (NGE) for every element.</li>
<li>The Next greater Element for an element x is the first greater element on the right side of x value in an array.</li>
<li>While the elements for which no greater element exist, consider the next greater element as 0.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/java/how-to-find-next-greater-element-for-every-element-in-an-array.gif" alt=" NGE for every element in an array" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>For any array, rightmost element always has next greater element as 0.</li>
<li>Next greater element of an array element array[i], is an integer array[j], such that
<ul>
<li>array[i] &lt; array[j]</li>
<li>i &lt; j</li>
<li>j &#8211; i is minimum</li>
</ul>
</li>
<li>i.e. array[j] is the first element on the right of array[i] which is greater than array[i].</li>
<li>For Example the Input array is 88, 13, 44, 2, 10, 5, 17</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-green">Output</h2>
</div>
</div>
<div class="Output" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs bash" data-lang=""><span class="nt">Next greater element <span class="hljs-keyword">for</span> <span class="hljs-number">13</span>     = <span class="hljs-number">44</span>
Next greater element <span class="hljs-keyword">for</span> <span class="hljs-number">2</span>      = <span class="hljs-number">10</span>
Next greater element <span class="hljs-keyword">for</span> <span class="hljs-number">5</span>      = <span class="hljs-number">17</span>
Next greater element <span class="hljs-keyword">for</span> <span class="hljs-number">10</span>     = <span class="hljs-number">17</span>
Next greater element <span class="hljs-keyword">for</span> <span class="hljs-number">17</span>     = <span class="hljs-number">0</span>
Next greater element <span class="hljs-keyword">for</span> <span class="hljs-number">44</span>     = <span class="hljs-number">0</span>
Next greater element <span class="hljs-keyword">for</span> <span class="hljs-number">88</span>     = <span class="hljs-number">0</span>
</span></code></pre>
</figure>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="steps-for-finding-a-next-greater-element" class="color-blue">Steps for finding a next greater element</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>To find Next Great Element Using two loops.</li>
<li>All the elements one by one to picks in the outer loop.</li>
<li>The outer loop picked the first greater element from the inner loop.</li>
<li>If a greater element is found then that element is printed as next, otherwise 0 is printed.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-blue" style="text-align: justify;">Sample Code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">class Wikitechy<br/>{ <br/>	/* prints element and NGE pair for <br/>	all elements of arr[] of size n */<br/>	static void printNGE(int arr[], int n) <br/>	{ <br/>		int n1, i, j; <br/>		for (i=0; i&lt;n; i++) <br/>		{ <br/>			n1 = 0; <br/>			for (j = i+1; j&lt;n; j++) <br/>			{ <br/>				if (arr[i] &lt; arr[j]) <br/>				{ <br/>					n1 = arr[j]; <br/>					break; <br/>				} <br/>			} <br/>			System.out.println(arr[i]+&quot; -- &quot;+n1); <br/>		} <br/>	} <br/>	<br/>	public static void main(String args[]) <br/>	{ <br/>		int arr[]= {30, 35, 11, 17, 2}; <br/>		int n = arr.length; <br/>		printNGE(arr, n);<br/>        <br/>	} <br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output-2" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs" data-lang=""><span class="nt">30 -- 35
35 -- 0
11 -- 17
17 -- 0
2 -- 0</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-find-next-greater-element-for-every-element-in-an-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to count number of characters in a string ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-count-number-of-characters-in-a-string/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-count-number-of-characters-in-a-string/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:34:34 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[char to string]]></category>
		<category><![CDATA[character count]]></category>
		<category><![CDATA[check string length]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[count characters in string]]></category>
		<category><![CDATA[count characters in string java]]></category>
		<category><![CDATA[count number of characters in a string]]></category>
		<category><![CDATA[count number of characters in a string in java]]></category>
		<category><![CDATA[count occurrences of character in string java using hashmap]]></category>
		<category><![CDATA[count repeated characters in string using java]]></category>
		<category><![CDATA[count words in string]]></category>
		<category><![CDATA[dark horse digital interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[excel count characters in string]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to count characters in string array in java]]></category>
		<category><![CDATA[how to count the number of occurrences of a character in a string in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java program to count number of alphabets in a string]]></category>
		<category><![CDATA[java program to count number of characters in a string]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[number of characters in a string]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[word counter]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=641</guid>

					<description><![CDATA[Answer : To count the amount of 'x' characters that are in a string...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-count-number-of-characters-in-a-string" class="color-pink">How to count number of characters in a string ?</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li>To count the amount of &#8216;x&#8217; characters that are in a string, and print out the number using java program.</li>
</ul>
</div>
</div>
<div class="CodeContent"></div>
<div class="Output">
<div class="hddn">
<figure class="highlight"><div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">class Wikitechy<br/>{ <br/>    // Method that return count of the given <br/>    // character in the string <br/>    public static int count(String s, char c) <br/>    { <br/>        int res = 0; <br/>  <br/>        for (int i=0; i&lt;s.length(); i++) <br/>        { <br/>            // checking character in string <br/>            if (s.charAt(i) == c) <br/>            res++; <br/>        }  <br/>        return res; <br/>    } <br/>      <br/>    // Driver method <br/>    public static void main(String args[]) <br/>    { <br/>        String str= &quot;Welcome to Wikitechy&quot;; <br/>        char c = &#039;W&#039;; <br/>        System.out.println(count(str, c)); <br/>    } <br/>} </code></pre> </div>
<h3 id="output">Output</h3>
<p>2</figure>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-count-number-of-characters-in-a-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Design Patterns in Java where input n=4 ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/design-patterns-in-java-where-input-n4/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/design-patterns-in-java-where-input-n4/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:34:23 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[alphabet pattern programs in java]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[character pattern programs in java]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[diamond number pattern programs in java]]></category>
		<category><![CDATA[diamond pattern programs in java]]></category>
		<category><![CDATA[different star pattern program in java]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[infrrd interview questions and answers]]></category>
		<category><![CDATA[java number pattern programs examples]]></category>
		<category><![CDATA[java pattern programs with explanation]]></category>
		<category><![CDATA[java program to print pattern of numbers]]></category>
		<category><![CDATA[java program to print patterns of numbers and stars]]></category>
		<category><![CDATA[java program to print pyramid of numbers]]></category>
		<category><![CDATA[java program to print pyramid pattern of stars]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[pyramid triangle program in java]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[reverse pyramid program in java]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=650</guid>

					<description><![CDATA[Answer : Pattern is an underlying structure that organizes surfaces...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="design-patterns-in-java-where-input-n4-output-like" class="color-pink" style="text-align: justify;">Design Patterns in Java where input n=4, output like</h2>
<div style="text-align: justify;">1<br />
2 3<br />
4 5 6<br />
7 8 9 10 ?</div>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Pattern is an underlying structure that organizes surfaces or structures in a consistent, regular manner. Pattern can be described as a repeating unit of shape or form.</li>
<li>Given a positive integer n.The problem is to print the pyramid pattern as designed the sample code is given below.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code" class="color-blue" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">import java.io.*;<br/>class Wikitechy {<br/> public static void main(String[] args) {<br/>  int val = 1, n = 4;<br/>  for (int i = 1; i &lt;= n; i++) <br/>  {<br/>   for (int j = 0; j &lt; i; j++) <br/>   {<br/>    System.out.print(val + &quot; &quot;);<br/>    val++;<br/>   }<br/>   System.out.println();<br/>  }<br/> }<br/>}</code></pre> </div>
<p style="text-align: justify;">
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/design-patterns-in-java-where-input-n4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Count Occurrence of a given Character in a String in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-count-occurrence-of-a-given-character-in-a-string-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-count-occurrence-of-a-given-character-in-a-string-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:34:18 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[c program to count number of characters in a string]]></category>
		<category><![CDATA[c program to find frequency of characters in a string]]></category>
		<category><![CDATA[c++ program to count the number of occurrences of a character in a string]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[count occurrences of each character in string java]]></category>
		<category><![CDATA[count repeated characters in string using java]]></category>
		<category><![CDATA[count the number of repeated characters in a given string in c]]></category>
		<category><![CDATA[count total number of times each alphabet appears in the string java program code with example]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to count occurrence of a given character in a string in java]]></category>
		<category><![CDATA[how to count the number of occurrences of each character in a string in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[infrrd interview questions and answers]]></category>
		<category><![CDATA[java program to count number of alphabets in a string]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[write a java program to count number of characters in given string]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=649</guid>

					<description><![CDATA[Answer : The number of occurrences of each character to be count...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-count-occurrence-of-a-given-character-in-a-string-in-java" class="color-pink" style="text-align: justify;">How to Count Occurrence of a given Character in a String in Java ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>The number of occurrences of each character to be count and also the occurrences of duplicate characters it should not be display repeatedly. The following steps are given below,
<ul>
<li>First, we split the strings by spaces.</li>
<li>Take a variable count = 0 and in every true condition we increment the count by 1.</li>
<li>Now run a loop at 0 to length of string.</li>
<li>And then check if our string is equal to the word.</li>
<li>If condition true then we increment the value of count by 1.</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"></div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-blue" style="text-align: justify;">Sample Code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">class wiki{<br/>	public static void main (String[] args) {<br/>	String str = &quot;Welcome to wikitechy website. Wikitechy is the best website to learn technology.&quot;<br/>String findStr = &quot;wikitechy&quot;;<br/>int lastIndex = 0;<br/>int count = 0;<br/><br/>while(lastIndex != -1){<br/><br/>    lastIndex = str.indexOf(findStr,lastIndex);<br/><br/>    if(lastIndex != -1){<br/>        count ++;<br/>        lastIndex += findStr.length();<br/>    }<br/>}<br/>System.out.println(count);<br/>	}<br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="CodeContent">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code id="code1" class="hljs" data-lang=""><span class="nt">2</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-count-occurrence-of-a-given-character-in-a-string-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Copy One Array to Another in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-copy-one-array-to-another-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-copy-one-array-to-another-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:34:11 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[c program to copy elements of one array to another array in reverse order]]></category>
		<category><![CDATA[c program to copy one array to another array using pointers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[clone array javascript]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[copy array using pointers in c]]></category>
		<category><![CDATA[copy json array to another in java]]></category>
		<category><![CDATA[copy one array to another in c in reverse order.]]></category>
		<category><![CDATA[copy one array to another in c using pointer]]></category>
		<category><![CDATA[copy one array to another in c++]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[how to store an array in another array in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[infrrd interview questions and answers]]></category>
		<category><![CDATA[java copy 2d array]]></category>
		<category><![CDATA[java copy a int array]]></category>
		<category><![CDATA[javascript copy array of objects]]></category>
		<category><![CDATA[javascript copy object]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=648</guid>

					<description><![CDATA[Answer : Java provides inbuilt methods to copy array...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-copy-one-array-to-another-in-java" class="color-pink">How to Copy One Array to Another in Java</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li>Java provides inbuilt methods to copy array. Whether we want a full copy or partial copy of array, we can do it easily using java inbuilt classes.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="object-clone" class="color-green">Object.clone():</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li>Object class provides <a href="https://www.wikitechy.com/tutorials/csharp/csharp-clone" target="_blank" rel="noopener">clone()</a> method and since array in java is also an Object, we can use this method to achieve full array copy.</li>
<li>If you want partial copy of the <a href="https://www.wikitechy.com/tutorials/java/how-to-sort-string-array-in-java" target="_blank" rel="noopener">array</a> we cant&#8217;t use this method.</li>
</ul>
</div>
</div>
<div class="text-center row"></div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-blue">Sample Code in Java</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">public class Wiki<br/>{ <br/>	public static void main(String[] args) <br/>	{ <br/>		int a[] = {2, 8, 3}; <br/><br/>		// Copy elements of a[] to b[] <br/>		int b[] = a.clone(); <br/><br/>		// Change b[] to verify that b[] is different <br/>		// from a[] <br/>	 <br/><br/>		System.out.println(&quot;Values of a[] &quot;); <br/>		for (int i=0; i&lt;a.length; i++) <br/>			System.out.print(a[i] + &quot; &quot;); <br/><br/>		System.out.println(&quot;\n\nValues of b[] &quot;); <br/>		for (int i=0; i&lt;b.length; i++) <br/>			System.out.print(b[i] + &quot; &quot;); <br/>	} <br/>}</code></pre> </div>
<div class="TextHeading">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight">
<pre><code class="hljs css" data-lang=""><span class="nt"><span class="hljs-tag">Values</span> <span class="hljs-tag">of</span> <span class="hljs-tag">a</span><span class="hljs-attr_selector">[]</span> 
2 8 3 

<span class="hljs-tag">Values</span> <span class="hljs-tag">of</span> <span class="hljs-tag">b</span><span class="hljs-attr_selector">[]</span> 
2 8 3</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-copy-one-array-to-another-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to check if two rectangles intersect or not ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-check-if-two-rectangles-intersect-or-not/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-check-if-two-rectangles-intersect-or-not/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:34:06 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[area of intersection of two rectangles]]></category>
		<category><![CDATA[area of intersection of two rectangles python]]></category>
		<category><![CDATA[area of overlapping rectangles algorithm]]></category>
		<category><![CDATA[area of overlapping rectangles java]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[check if two rotated rectangles intersect]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[determine if two rectangles overlap python]]></category>
		<category><![CDATA[find the intersection of two rectangles c]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[geekyants interview questions and answers]]></category>
		<category><![CDATA[how to find intersection of two rectangles in c]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[intersection of rectangles in c]]></category>
		<category><![CDATA[intersection of two rectangles in c]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[overlapping rectangles]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[rectangle intersection algorithm]]></category>
		<category><![CDATA[rectangle overlap area c++]]></category>
		<category><![CDATA[rectangle overlap leetcode]]></category>
		<category><![CDATA[rectangle overlap lintcode]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[to check if two rectangles are intersecting or not]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[write a c program to find the intersection of the two given rectangles.]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=647</guid>

					<description><![CDATA[Answer : The following standard Java coding practices to solve...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-check-if-two-rectangles-intersect-or-not" class="color-pink" style="text-align: justify;">How to check if two rectangles intersect or not ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>The following standard Java coding practices to solve this problem.</li>
<li>We have an encapsulated two co-ordinates in a Point class and have Rectangle has two Point <a href="https://www.wikitechy.com/tutorials/ruby-on-rails/avoid-instance-variables-use-getters-and-setters" target="_blank" rel="noopener">instance variable</a> and an instance method like <a href="https://www.wikitechy.com/tutorials/java/java-strings-equals" target="_blank" rel="noopener">equals()</a> to check if another rectangle is overlapping or not.</li>
</ul>
</li>
</ul>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/java/how-to-check-if-two-rectangles-intersect-or-not.jpg" alt=" To Check Rectangle Intersects or Not" /></div>
</div>
<ul>
<li>A rectangle can be represented by two coordinates, top left, and bottom right. As part of the problem you will be given four coordinates L1, R1 and L2, R2, top left and bottom right coordinate of two rectangles and you need to write a function isOverlapping() which should return true if rectangles are overlapping or false if they are not.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"></div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code-in-java" class="color-blue" style="text-align: justify;">Sample Code in Java:</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">public class Main {<br/><br/>  public static void main(String[] args) {<br/>  Point l1 = new Point(0, 10);<br/>  Point r1 = new Point(10, 0);<br/>  Point l2 = new Point(5, 5);<br/>  Point r2 = new Point(15, 0);<br/><br/>  Rectangle first = new Rectangle(l1, r1);<br/>  Rectangle second = new Rectangle(l2, r2);<br/><br/>  if (first.isOverLapping(second)) {<br/>  System.out<br/>  .println(&quot;Yes, two rectangles are intersecting with each other&quot;);<br/>  } else {<br/>  System.out<br/>  .println(&quot;No, two rectangles are not overlapping with each other&quot;);<br/>  }<br/>  }<br/><br/>}<br/><br/>class Point {<br/>  int x;<br/>  int y;<br/><br/>  public Point(int x, int y) {<br/>  super();<br/>  this.x = x;<br/>  this.y = y;<br/>  }<br/>}<br/><br/>class Rectangle {<br/><br/>  private final Point topLeft;<br/>  private final Point bottomRight;<br/><br/>  public Rectangle(Point topLeft, Point bottomRight) {<br/>  this.topLeft = topLeft;<br/>  this.bottomRight = bottomRight;<br/>  }<br/><br/>  public boolean isOverLapping(Rectangle other) {<br/>  if (this.topLeft.x &gt; other.bottomRight.x // R1 is right to R2<br/>  || this.bottomRight.x &lt; other.topLeft.x // R1 is left to R2<br/>  || this.topLeft.y &lt; other.bottomRight.y // R1 is above R2<br/>  || this.bottomRight.y &gt; other.topLeft.y) { // R1 is below R1<br/>  return false;<br/>  }<br/>  return true;<br/>  }<br/><br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs javascript" data-lang=""><span class="nt">Yes, two rectangles are intersecting <span class="hljs-keyword">with</span> each other</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-check-if-two-rectangles-intersect-or-not/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Linear Sort in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/what-is-linear-sort-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/what-is-linear-sort-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:33:59 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Craterzone Interview Questions and Answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[linear algorithm example]]></category>
		<category><![CDATA[linear insertion sort]]></category>
		<category><![CDATA[linear search algorithm]]></category>
		<category><![CDATA[linear search algorithm in data structure]]></category>
		<category><![CDATA[linear search algorithm java]]></category>
		<category><![CDATA[linear search in c]]></category>
		<category><![CDATA[linear sort]]></category>
		<category><![CDATA[linear sort in c]]></category>
		<category><![CDATA[linear sort in java]]></category>
		<category><![CDATA[linear sorting algorithm]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=646</guid>

					<description><![CDATA[Answer : One of the simplest Sorting techniques is a linear sort...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="what-is-linear-sort-in-java" class="color-pink" style="text-align: justify;">What is Linear Sort in Java ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>One of the simplest Sorting techniques is a linear sort.</li>
<li>Linear sort is the selection of an element and keeping it in sorted order.</li>
<li>In linear sort, the strategy is to find the smallest number in the array and exchange it with the value in first position of array.</li>
<li>Now, find the second smallest element in the remainder of array and exchange it with a value in the second position, carry on till you have reached the end of array.</li>
<li>Now all the elements have been sorted in ascending order.</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block" src="https://cdn.wikitechy.com/interview-questions/java/what-is-linear-sorting.png" alt=" Linear Sorting" /></div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code" class="color-blue" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">// Java program for implementation of Selection Sort <br/>class SelectionSort <br/>{ <br/>    void sort(int arr[]) <br/>    { <br/>        int n = arr.length; <br/>  <br/>        // One by one move boundary of unsorted subarray <br/>        for (int i = 0; i &lt; n-1; i++) <br/>        { <br/>            // Find the minimum element in unsorted array <br/>            int min_idx = i; <br/>            for (int j = i+1; j &lt; n; j++) <br/>                if (arr[j] &lt; arr[min_idx]) <br/>                    min_idx = j; <br/>  <br/>            // Swap the found minimum element with the first <br/>            // element <br/>            int temp = arr[min_idx]; <br/>            arr[min_idx] = arr[i]; <br/>            arr[i] = temp; <br/>        } <br/>    } <br/>  <br/>    // Prints the array <br/>    void printArray(int arr[]) <br/>    { <br/>        int n = arr.length; <br/>        for (int i=0; i&lt;n; ++i) <br/>            System.out.print(arr[i]+&quot; &quot;); <br/>        System.out.println(); <br/>    } <br/>  <br/>    // Driver code to test above <br/>    public static void main(String args[]) <br/>    { <br/>        SelectionSort ob = new SelectionSort(); <br/>        int arr[] = {27,28,45,68,32}; <br/>        ob.sort(arr); <br/>        System.out.println(&quot;Sorted array&quot;); <br/>        ob.printArray(arr); <br/>    } <br/>} </code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs" data-lang=""><span class="nt">Sorted array:
27 28 32 45 68 </span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/what-is-linear-sort-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Decode URL content in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-decode-url-content-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-decode-url-content-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:33:53 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Craterzone Interview Questions and Answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[encode string in java]]></category>
		<category><![CDATA[encoding and decoding in java example]]></category>
		<category><![CDATA[encoding and decoding program in java]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[java decode string]]></category>
		<category><![CDATA[java encode url path]]></category>
		<category><![CDATA[java program to encode and decode a string]]></category>
		<category><![CDATA[java uri encode]]></category>
		<category><![CDATA[java url decode]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[url decode]]></category>
		<category><![CDATA[url encode]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=645</guid>

					<description><![CDATA[Answer : The task to the reverse of URL encoding and distinct from URL parser is called Url Decoding..]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-decode-url-content-in-java" class="color-pink" style="text-align: justify;">How to Decode URL content in Java ?</h2>
<ul style="text-align: justify;">
<li>The task to the reverse of URL encoding and distinct from URL parser is called Url Decoding.</li>
<li>It is a common requirement to implement URL encoding and decoding in Java while creating crawlers or downloaders.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"></div>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/java/decode-url.jpg" alt=" Decode URL" /></div>
</div>
<p style="text-align: justify;" align="center">Decode URL</p>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<p>The Decode URL following steps are given below,</p>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul style="text-align: justify;">
<li>The same URL can be encoded multiple times, we need to decode it until the URL cannnot be decoded further. For example, &#8220;video%252Fmp4&#8221; is the result of two encodings. Upon decoding it once, we get &#8220;video%2Fmp4&#8221;. Now the URL needs to be further decoded so that we get &#8220;video/mp4&#8221;, which is the result.</li>
<li>We use the decode method of a predefined Java class named URLDecoder.</li>
<li>The decode method of URLDecoder takes two arguments:
<ul>
<li>The first argument defines the URL to be decoded.</li>
<li>The second argument defines the decoding scheme to be used.</li>
</ul>
</li>
<li>After decoding, the resulting decoded URL is returned.</li>
<li>We create two variables: prevURL, which is empty, and decodeURL, which contains the URL to be decoded.</li>
<li>We create an iteration that runs until prevURL!=decodeURL</li>
<li>Now we update prevURL to decodeURL and update decodeURL with the decoded value of the URL passed.</li>
<li>As you can see, prevURL!=decodeURL, so we run it again and again.</li>
<li>Now, prevURL=decodeURL, so the decoded URL is returned.</li>
</ul>
<h2 id="sample-code" class="color-purple" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">import java.io.UnsupportedEncodingException;<br/>import java.net.URLDecoder;<br/> <br/>public class DecodeURLExample {<br/>    public static void main(String a[]){<br/>        try {<br/>            System.out.println(URLDecoder.decode(&quot;special+chars%3A+%26%25*+&quot;, &quot;UTF-8&quot;));<br/>        } catch (UnsupportedEncodingException ex) {<br/>            ex.printStackTrace();<br/>        }<br/>    }<br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs" data-lang=""><span class="nt">special chars: &amp;%* </span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-decode-url-content-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference Between static and dynamic binding in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/difference-between-static-and-dynamic-binding-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/difference-between-static-and-dynamic-binding-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:33:43 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Craterzone Interview Questions and Answers]]></category>
		<category><![CDATA[data binding in java]]></category>
		<category><![CDATA[definition of dynamic binding in java]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[difference between static and dynamic variable]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[late binding]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[static and dynamic examples]]></category>
		<category><![CDATA[static and dynamic objects]]></category>
		<category><![CDATA[static binding and dynamic binding in oops]]></category>
		<category><![CDATA[static binding definition]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is binding in oops]]></category>
		<category><![CDATA[what is dynamic binding]]></category>
		<category><![CDATA[what is static and dynamic binding in java]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=644</guid>

					<description><![CDATA[Answer : Events occur at compile time....]]></description>
										<content:encoded><![CDATA[<h2 id="difference-between-static-and-dynamic-binding-in-java" class="color-pink">Difference Between static and dynamic binding in Java</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-4221" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/static-and-dynamic-binding.png" alt="" width="922" height="668" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/static-and-dynamic-binding.png 922w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/static-and-dynamic-binding-300x217.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/static-and-dynamic-binding-768x556.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/static-and-dynamic-binding-390x283.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/static-and-dynamic-binding-820x594.png 820w" sizes="(max-width: 922px) 100vw, 922px" /></p>
<table class="table-bordered table-striped table table-responsive">
<tbody>
<tr>
<th><a href="https://www.wikitechy.com/interview-questions/java/what-is-static-and-dynamic-binding-in-java/" target="_blank" rel="noopener">Static Binding</a></th>
<th><a href="https://www.wikitechy.com/interview-questions/java/what-is-static-and-dynamic-binding-in-java/" target="_blank" rel="noopener">Dynamic Binding</a></th>
</tr>
<tr>
<td class="text-leftalign">Events occur at compile time</td>
<td class="text-leftalign">Events occur at run time.</td>
</tr>
<tr>
<td class="text-leftalign">All information needed to call a function is known<br />
at the compile time.<br />
Static binding uses Type(Class in Java)<br />
information for binding</td>
<td class="text-leftalign">All information need to call a function come to know at the run time.<br />
Dynamic binding uses Object to resolve binding.</td>
</tr>
<tr>
<td class="text-leftalign">The advantage of static binding is Efficiency</td>
<td class="text-leftalign">The advantage of dynamic binding is Flexibility.</td>
</tr>
<tr>
<td class="text-leftalign">Fast Execution</td>
<td class="text-leftalign">Slow Execution.</td>
</tr>
<tr>
<td class="text-leftalign">Static binding is also called as Early Binding.</td>
<td class="text-leftalign">Static binding is called as Late Binding.</td>
</tr>
<tr>
<td class="text-leftalign">
<ul>
<li>Problem occurs,
<ul>
<li>Binding of a name</li>
<li>Activation of a procedure</li>
<li>Lifetime of a binding</li>
</ul>
</li>
</ul>
</td>
<td class="text-leftalign">
<ul>
<li>Problem occurs,
<ul>
<li>Declaration of a name(variable, etc.)</li>
<li>Scope of the declaration.</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr>
<td class="text-leftalign">Overloaded function call, Overloaded operators.</td>
<td class="text-leftalign">Virtual function in C++, overridden methods in java.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/difference-between-static-and-dynamic-binding-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to find the Longest Palindrome String in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-to-find-the-longest-palindrome-string-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-to-find-the-longest-palindrome-string-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:33:34 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Craterzone Interview Questions and Answers]]></category>
		<category><![CDATA[define palindrome]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[find longest palindrome in a string dynamic programming]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[longest palindromic substring java]]></category>
		<category><![CDATA[longest palindromic substring o(n)]]></category>
		<category><![CDATA[longest palindromic substring recursion]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[palindrome string program in java]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[print longest palindromic subsequence]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[string palindrome in java]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is a palindrome]]></category>
		<category><![CDATA[what's a palindrome]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=643</guid>

					<description><![CDATA[Answer : A palindrome is a word, phrase, number, or other sequence of characters...
]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-to-find-the-longest-palindrome-string-in-java" class="color-pink" style="text-align: justify;">How to find the Longest Palindrome String in Java ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward, example as madam.</li>
<li>Write a java program to find the longest palindrome present in a given string.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/java/longest-palindrome-%20in-a-string.png" alt=" Longest Palindrome in a String" /></div>
</div>
<p style="text-align: justify;" align="center">Longest Palindrome in a String Using Java</p>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"></div>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>The string can be of odd or even length and hence the findLongestPalindromeWithSpecifiedParameter() is called twice for each string.</li>
<li>In the method, findLongestPalindromeWithSpecifiedParameter() left will decrement and move towards the start of the string until it reaches start and then right will increment and move towards the end of the string until it reaches the end.</li>
<li>And any left and right reach destination (i.e. start and end respectively)at any point then the method will return.</li>
</ul>
</div>
</div>
<div class="TextHeading">
<div class="hddn">
<h2 id="sample-code" class="color-blue" style="text-align: justify;">Sample Code</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">import java.io.*;<br/><br/><br/>public class LongestPalindromeExample {<br/><br/>    public String findTheLongestPalindrome(String str){<br/>        if (str == null) {<br/>            return null;<br/>        }<br/>        String longestPalindrome = String.valueOf(str.charAt(0));<br/>        for (int i = 0; i &lt; str.length() - 1; i++) {<br/>            String returnedPalindrome = findLongestPalindromeWithSpecifiedParameter(str, i, i);<br/>            if (returnedPalindrome.length() &gt; longestPalindrome.length()) {<br/>                longestPalindrome = returnedPalindrome;<br/>            }<br/>            returnedPalindrome = findLongestPalindromeWithSpecifiedParameter(str, i, i + 1);<br/>            if (returnedPalindrome.length() &gt; longestPalindrome.length()) {<br/>                longestPalindrome = returnedPalindrome;<br/>            }<br/>        }<br/>        return longestPalindrome;<br/>    }<br/><br/>    public String findLongestPalindromeWithSpecifiedParameter(String str, int left, int right) {<br/>        if (left &gt; right)<br/>            return null;<br/><br/>        while (left &gt;= 0 &amp;&amp; right &lt; str.length() &amp;&amp; str.charAt(left) == str.charAt(right)) {<br/>            left--;<br/>            right++;<br/>        }<br/>        return str.substring(left + 1, right);<br/>    }<br/><br/>    public static void main(String[] args){<br/>        LongestPalindromeExample longestPalindrome1 = new LongestPalindromeExample();<br/>        System.out.println(&quot;Longest palindrome in abcmadamcbamadam is &quot; + longestPalindrome1.findTheLongestPalindrome(&quot;abcmadamcbamadam&quot;));<br/>        System.out.println(&quot;Longest palindrome in abcba is &quot; + longestPalindrome1.findTheLongestPalindrome(&quot;abcba&quot;));<br/>    }<br/>}</code></pre> </div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output</h2>
</div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs bash" data-lang=""><span class="nt">Longest palindrome <span class="hljs-keyword">in</span> abcmadamcbamadam is abcmadamcba
Longest palindrome <span class="hljs-keyword">in</span> abcba is abcba</span></code></pre>
</figure>
</div>
</div>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-to-find-the-longest-palindrome-string-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
