Java Introduction
Java Introduction
=====
Object oriented programming language.
Platform independent programming language.
Case sensitive programming language.
Strongly typed checking language.
High level language.
Open source programming language.
1995 --> James Gosling --> Sun Micro system --> Oracle Corporation
Java software --> JDK software
C
===
Procedure oriented programming language.
Platform dependent programming language.
Case sensitive programming language.
Loosely typed checking language.
Middle level language (LOW + HIGH)
Interview Questions
==================
Q)What is Java ?
Java is a object oriented, platform independent ,case sensitive, strongly typed
checking, high level , open source programming language developed by James Gosling
in the year of 1995.
Programming language
=====================
A language which is used to communicate between user and computer is called
programming language.
Programming language acts like a mediator or interface between user and computer.
Diagram:1
ex:
Machine Language
Assembly Language
Machine Language
-----------------
It is a fundemantal language of a computer which is combination of
0's and 1's.
Advantages:
Disadvantages:
> Whenever error raised in our program then locating and handling that error
becomes difficult.
Assembly Language
-----------------
The second generation language came into an existence is called assembly language.
i)Assembler
ii)Compiler
iii)Interpreter
i)Assembler
----------
It is one of the translator which converts assemblic code to machine code.
Merits:
> If anywhere error raised in our program locating and handling that error
becomes easy.
Demerits:
Q)What is Debugging?
The process of eliminating the bugs from the application is called debugging.
ex:
C++, Java, .Net , Python , Perl and etc.
Computer will not understand high level language directly. We required translators.
compiler
--------
It will compile and execute our program at at time.
interpreter
----------
It will execute our program line by line procedure.
Adantages:
Disadvantages:
> A program writtens in high level language consumes huge amount of memory.
Types of IT companies
======================
1) \n (new line)
2) \t (horizontal tab)
3) \b (back space)
4) \r (carriage return)
5) \f (form feeding)
6) \\ (back slash)
and etc.
1) \n (new line)
-----------------
class Ashwini
{
public static void main(String[] args)
{
System.out.println("IHUB\nTALENT");
}
}
o/p:
IHUB
TALENT
2) \t (horizontal tab)
------------------------
class Badrinath
{
public static void main(String[] args)
{
System.out.println("IHUB\tTALENT");
}
}
o/p:
IHUB TALENT
3) \b (back space)
-------------------
class Radha
{
public static void main(String[] args)
{
System.out.println("I\bHUBTALENT");
}
}
o/p:
HUBTALENT
ex:
----
class Ajay
{
public static void main(String[] args)
{
System.out.println("IHUB\b\b\bTALENT");
}
}
o/p:
ITALENT
4) \r (carriage return)
-------------------------
class Prakash
{
public static void main(String[] args)
{
System.out.println("IHUB\rTALENT");
}
}
o/p:
TALENT
ex:
---
class Manisha
{
public static void main(String[] args)
{
System.out.println("TALENT\rIHUB");
}
}
o/p:
IHUBNT
6) \\ (back slash)
--------------------
class Jyothi
{
public static void main(String[] args)
{
System.out.println("IHUB\\TALENT");
}
}
o/p:
IHUB\TALENT
C program
=========
void main()
{
clrscr();
printf("%d"); //0
getch();
}
ex:
void main()
{
clrscr();
printf("%%d"); //%d
getch();
}
Screening Test program
=======================
Q)What will be the output of below code?
class Example
{
public static void main(String[] args)
{
System.out.print("\nle");
System.out.print("\bpi");
System.out.print("\rha");
}
}
o/p:
hai