Top 15 Java Programmes for Interview

Top 15 Java Programmes for Interview


        It's very essential  to crack MCQ test along with the programming  test in Java interview . Interviewer usually asked basic logical program.  They are checking your coding skill but in term of logical. They asked basic program. Let's started without wasting time find below programmes  which are mostly asked Interview Programmes in Java interview.

1. Prime Number :  Write a Program to find the given number is prime or not .


This is very frequently program asked in interview room. Before writing a program for that you should know definition of the prime number. A Number which is only divisible by 1 and its self is called as prime number. e.g. 3, 5,7, 11 etc.

1. Program to check Given Number is Prime or Not.

import java.util.Scanner;
public class javaprogram
{
public static void main(String args[])
{
int i;
boolean flag = true;
Scanner scan = new Scanner(System.in);
System.out.print("Enter a Number : ");
int num = scan.nextInt();
// Reduce time complexity using==>; for(i=2; i<= num /2; i++)
for(i=2; i< num ; i++)
               {
if (num % i == 0)
{
flag = false;
break;
}
}
if(flag)
{
System.out.print("This "+num+" is a Prime Number");
}
else
{
System.out.print("This "+num+" is not a Prime Number");
}
}
}


2. Reverse String  :  Write a Program to print given String in reverse.


This is another program commonly asked in java interview. 

// Program for Reverse String.

import java.util.Scanner;
public class javaprogram
{
public static void main(String[] args)
{
System.out.println("Enter string to reverse:");
Scanner read = new Scanner(System.in);
String str = read.nextLine();
String reverse = "";
for(int i = str.length() - 1; i >= 0; i--)
{
reverse = reverse + str.charAt(i);
}
System.out.println("Reversed string is:");
System.out.println(reverse);
}

}

3. Reverse String  :  Without any library and indexing function.


When interviewer asked for reverse String you can easily write a program using Library  method or indexing method but on same time he asked for same programme without use of any indexing function. There are so many way of reverse the String but we can see one of them and simplest  to understand. 
Here we can swap the first char(element) to last one, then 2nd char to 2nd last one, and so on up to the middle of the string.

// Program for Reverse String without using function.

public class RevString
{
public static void main(String args[])
{
Scanner scn=new Scanner(System.in);
System.out.println("Enter the String");
String str=scn.nextLine();
char []rev=str.toCharArray();
int j=str.length()-1;
for(int i=0;i<=(rev.length)/2;i++)
{
char temp=rev[i];
rev[i]=rev[j];
rev[j]=temp;
j--;
}
System.out.println(new String(rev));
}
}

4. Bubble Sort :  Write a Program to bubble sort.


Bubble sort is simple algorithm among the other algorithm of sorting the elements. In this sort algorithm first element is compare to the second element and if first element is greater than second then swap between these two element take place, loop the same step to next element util the condition is true. Repeated the above step to nth number elements or time. 

// Program for Bubble Sort.

public class BubbleSort
{
public static void main(String[] args)
{
int arr[] = { 1, 5, 2, -2, -4, -1, 8, 0, -5, 9, 4,11 };
System.out.println("Elements Before Bubble Sort : ");

for (int i = 0; i &lt; arr.length; i++)
{
System.out.print(arr[i] + " ");
}
System.out.println();
bubbleSort(arr);
System.out.println("Elements After Bubble Sort : ");
for (int i = 0; i< arr.length; i++)
{
System.out.print(arr[i] + " ");
}
}

static void bubbleSort(int[] arr)
{
int temp = 0;
int n = arr.length;
for (int i = 0; i< n; i++)
{
for (int j = 0; j < (n - i)-1; j++)
{
if (arr[j]> arr[j+1])
{
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
}
}
}
}



5. Unique Elements from array :  Write a Program to print unique or distinct elements from an array.


Program in java interview. 

// Program for Unique Elements from an array

public class UniqueArray
{
public static void main(String[] args)
{
int uniarr[]=new int[] {1,2,3,22,3,4,5,23,3,5,7,4,5,6,9};
for(int i=0;i {
boolean flag=false;
for(int j=0;j {
if(i!=j &&uniarr[i]==uniarr[j])
{
flag=true;
break;
}
}
if(!flag)
{
System.out.print(uniarr[i]+" ");
}
}
}
}


6. Duplicate elements from list  :  Write a Program to find duplicate elements from list .


Program in java interview. 

// Program for Duplicate elements from list.

import java.util.ArrayList;
import java.util.HashSet;

public class UniqueArray
{
public static void main(String[] args)
{

ArrayList ls=new ArrayList<>():
ls.add(1);
ls.add(2);
ls.add(3);
ls.add(2);
ls.add(4);
ls.add(5);
ls.add(4);
ls.add(9);
HashSet lset=new HashSet();
for(Integer i:ls)
{
if(!lset.add(i))
System.out.println(i.toString());
}

}
}



Latest New Diwali Rangoli Collection 2019

Diwali Rangoli 2019 Latest Collection

                                                  This is one of the special Design Rangoli. It's multi-color rangoli.

2019  Diwali Rangoli  #1

Marathi Culture
Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.
aaply hya post var latest Rangoli midtal.

                                     Diwali Rangoli new Design pattern. Galicha pattern Rangoli
Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.

aaply hya post var latest Rangoli midtal.

2019  Diwali Rangoli  #2



                          Diwali Rangoli new Design pattern. Galicha pattern Rangoli
                          Diwali Rangoli new Design pattern. Galicha pattern Rangoli

2019  Diwali Rangoli  #3


2019  Diwali Rangoli  #4

        Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.
aaply hya post var latest Rangoli midtal.

2016  Diwali Rangoli  #5

Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.
aaply hya post var latest Rangoli midtal.
               

2019  Diwali Rangoli  #6

Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.
aaply hya post var latest Rangoli midtal.

2019  Diwali Rangoli  #7


Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.
aaply hya post var latest Rangoli midtal.

2019  Diwali Rangoli  #8

Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.
aaply hya post var latest Rangoli midtal.

2019  Diwali Rangoli  #9

Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
f
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.
aaply hya post var latest Rangoli midtal.

2019  Diwali Rangoli  #10


Apply Bharat "Rangoli" hi ek marathi Sankruti aahe,
Bharatat jawal-pass aapan  dar roj dara Pudhe aani aanganat rangoli kadatat.

aaply hya post var latest Rangoli midtal.

What is difference between JDK, JRE and JVM?

What is difference between JDK, JRE and JVM?

               JVM, JRE, JDK are these 3 main components that help with the running of Java coded programs. These three are termed as core part of Java programming language. However, they are three different concepts.

             JDK stands for Java Development Kit. It provides all the tools, it's contain binaries  and executable files which are required to compile, debug and execute a java program. Hence, it is a core component of Java Environment. Java Develomeny Kit is platform specific, which means that there is a different JDK for unix, mac, windows etc.  JDK  is super contains with JRE ,Java compiler, debugger and core classes.
            JRE stands for Java Runtime Environment. It is primarily used to provide a runtime environment that facilitates the implementation of JVM. It primarily contains the set of core libraries and other files that JVM requires while executing Java code. JRE is platform dependent we need to install JRE as per hardware and software specif.
           JVM, stands for Java Virtual Machine. It is an  runtime environment where the Java bytecode can be executed byte by bye on mechhine. JVM is responsible for loading .class file, linking , verifying bye code, allocating memory in Memory area and executing the code. JVM is also platform dependent, as each platform has different specifics and configurations.
           Basically, JDK helps compile Java source code, whereas JVM is what actually runs the Java code on machine, and JRE is Specification of JVM where java code runs.

Set Java path and Classpath from Command Prompt ( cmd ).

           To run a java program we need to set "path" and "classpath".
 1. Path : path can use to find executable file. here we specify required all executable file. that means .exe files. e.g. java.exe, javac.exe,  javadoc.exe, jar.exe etc .
  2. classpath: classpath is used to specify to find class files.


Let's Do Practically
                                    Set Path from command prompt
             Step 1 : Open Cmd (Command Prompt)
             Step 2  : Type : set path=C:\Program Files\Java\jdk1.8.0_121\bin ; . ;
             Step 3  : Hit  Enter
                           Note - bin folder contains all executable file.
                                      Don't forget to give semi-colon(;)  then  . (dot) and then semicolon(;)




let's check it 
try to run any java command like jar javac. javadoc etc (without parameters)

let me show you one of them , how to get java version . for this run following command 

                               cmd=> C:\Users\Gstar>;java -version
                                                                         (Hit Enter)

                                                      



                                                                    OR
                     lets run javac cmd. it show following result.

                              cmd=> C:\Users\Gstar>;javac
                                                                         (Hit Enter)




                                    Set classpath from command prompt

             Step 1 : Open Cmd (Command Prompt)
             Step 2  : Type : set classpath=C:\Program Files\Java\jdk1.8.0_121\bin ; . ;
             Step 3  : Hit  Enter
                           Note - rt.jar contains java classes in form of archive file .
                                      Don't forget to give semi-colon(;)  then  . (dot) and then semicolon(;)
                                   
                                            Run any simple java program for test purpose



                                                  Done!

Timepass 2 ( TP2 ) Marathi Movies Download Torrents

Time Pass 2


Timepass 2 (2015) Marathi x264 DVDRip.mkv format  - ( Size: 681.9 MB )



Torrent File Download


      Internal Files
Timepass 2 (2015) New DVDSCR E-Sub Team EXD[John -Rip]

Timepass 2( 2015) New DVDSCR E-Sub TeamEXD[John -Rip].avi   860.91 MB

sample.avi   5.53 MB

Torrent Downloaded From ExtraTorrent.cc.txt   446 Byte

Follow the below 2 step to downlaod TP 2 moive torrent file

Step 1. Click on below torrent location link. Link will be open in  New Window as shown below image

                                Link :  torrent location (click here)
               

Step2. click on  : as show above image .
               3. Done. now you can open this torrent file in any torrent software.



Option 1

Download Timepass 2 Marathi Movie Torrent File
      as show above step.

Option 2

Download Timepass 2 Marathi Movie File Direct Torrent Site

 torrent location :

Link 1:
http://extratorrent.cc/torrent/4268851/Timepass+2+%282015%29+Marathi+-+New+DVDSCR+E-Sub+Team+EXD%5BJohn+-Rip%5D.html



Link 2:
http://extratorrent.cc/torrent_download/4268851/Timepass+2+%282015%29+Marathi+-+New+DVDSCR+E-Sub+Team+EXD%5BJohn+-Rip%5D.torrent


Movie Info:



Director: Ravi Jadhav
Cast and Crew: Priya Bapat, Priyadarshan Jadhav, Prathamesh Parab, Ketaki Mategaonkar, Vaibhav Mangle, Bhau Kadam
Music by: Chinar-Mahesh
Release Date: May 1, 2015
Language of movie: Marathi
Composers:- Chinar Mahesh
Singers:- Vishal Dadlani, Mahalaxmi Iyer, Shalmali Kholgade, Nikhil DS
Genre:- , Music, Soundtrack
Bitrate:- 320Kbps/CBR
Audio codec: MP3 
4Lenght:- 00:28:48 Min 
Tracks:- 07 
File Size:- 66.7 MB 
Cover:- Yes 
Song Released Date : March 31, 2015

Timepass 2 Movies All MP3 Songs
01 - Waou-Waou-Vishal-Dadlani-3:32.mp3 - 8 MB
02 - Praju-Mahalaxmi-Iyer-and-Rishikesh-Kamerkar-5:18.mp3 - 12 MB
03 - Tu-Mila-Shalmali-Kholgade-and-Nikhil-DSouza-5:20.mp3 - 12 MB
04 - Madan-Pichkari.mp3-Apeksha-Dandekar-and-Ishq-Bector-4:19.mp3 - 10 MB
05 - Sunya-Sunya-Ketaki-Mategaonkar-and-Adarsh-Shinde-5:15.mp3 - 12 MB
06 - Dagadu-Savdhan-Rishikesh-Kamerkar-Chinar-Kharkar-and-Vivek-Naik-2:06.mp3 - 5 MB
07 - Timepass-Anand-Shinde-2:57.mp3 - 7 MB


Timepass 2 Story :

After long time the foremost hoped-for a second a part of timepass movie is part of. briefly it's known as as TP2. Timepass 2 is that the forthcoming Marathi movie that may be a second a part of timepass movie. This movie is all regarding love, relationship, trust that is sequel of super story. however in time pass 2, director replaced Dagadu and Prajakta’s role. so that marathi actor, you think that are going to be most suited to such full of madness role, yes…,its Priyadarshan Jadhav. Dagadu’s role are going to be vie by Priyadarshan Jadhav. Priyadarshan Jadhav is enjoying Dagadu’s college life role and Prajakta’s role is played by Priya Bapat so that’s why the fans of your time pass 2 ar somewhat upset regarding it.

 


TIMEPASS2 (TP2) DIALOGUES

Timepass2 (Tp2) Dialogues are written by Ravi Jadhav, Kshitij Patwardhan, Priyadarshan Jadhav. Timepass2 (Tp2) Dialogues are written nicely and hope the people just like the Timepass2 (Tp2) Dialogues as a result of Timepass movie got a lot of attention from the dialogues. Prathmesh Parab and Ketaki Mategaonkar have done the superb work and perfectly says the dialogue that’s the one reason movie got such a lot appreciation.

TIMEPASS2 (TP2) STORY

In timepass movie, we have a tendency to saw Dagadu and Prajakta felt in love {and then|then|so|and so} separated by their parents so what would be future story?? It could be another place, another town, another story of Dagadu and Prajakta. In Timepass2 (Tp2), we will see the passed through Dagadu and Prajakta and what\'s going to happened after they meet one another, all of this is often progressing to be very interesting to ascertain in the Timepass (Tp2). Main Timepass (Tp2) story is Dagadu and Prajakta meets when twelfth and Dagadu started doing his graduation in same college wherever Prajakta is finding out. The twist of the story is Prajakta doesn’t know he is conjointly finding out in same college and accidently they meet so what happened after they meet when long time. we can these we will things within the movie. so Timepass (Tp2) story is so interesting, we have a tendency to hope people can enjoy this movie.





F.Y.B.Sc. Lab course assignments Semester – I and II

Java Assignments
North Maharashtra University, Jalgaon
F. Y. B. Sc. (Computer Science) (w.e.f. June -2009)
Syllabus for UG-CS 103: Lab course
Semester –I
1. Program using various arithmetic operator
2. Program using control statement(if, if-else, if-else nesting ,switch)
3. Program using various loops(for, while ,do-while, nesting)(eg prime ,factorial, fibbonacci )
4. Program using 1-D arrays(eg:-sorting ,searching)
5. Program using 2-D array(eg:-matrix operation)
6. Program using function(call by value, call by reference, recursive)
7. Program using user define string function(at least two practical)
Semester –II
8. Program using pointers(arrays, functions, structures)
9. Program using structures(at least two practical)
10. Program using graphics function(at least two practical)
11. Simple program using file(to be cover all functions)
12. Program using files with structures
13. Program using command line argument

We will Provide all above lab course Assignment As Soon As Possible.

1. Program using various arithmetic operator

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
 int ch;
 float a,b,res;
 clrscr();
 printf("Enter two numbers:");
 scanf("%f%f",&a,&b);
 printf("\nMenu\n1.Addition\n2.Subtraction\n3.Multiplication\n4.Division");
 printf("\nEnter your choice:");
 scanf("%d",&ch);

  switch(ch)
 {
  case 1: res=a+b;
   break;
  case 2: res=a-b;
   break;
  case 3: res=a*b;
   break;
  case 4: res=a/b;
   break;
  default: printf("Wrong choice!!\nPress any key...");
    getch();
    exit(0);
 }

  printf("\nResult=%f",res);
 getch();
}
Out Put as like:







Shell Programming

#Shell script to a number below 50 and display its square

 clear