[go: up one dir, main page]

0% found this document useful (0 votes)
44 views9 pages

Java Introduction

The document discusses several programming languages and concepts. It describes Java as an object oriented, platform independent language developed in 1995. It also describes C as a procedure oriented language. It then discusses programming language types, escape characters, and provides examples of C programs.

Uploaded by

umamucheli34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views9 pages

Java Introduction

The document discusses several programming languages and concepts. It describes Java as an object oriented, platform independent language developed in 1995. It also describes C as a procedure oriented language. It then discusses programming language types, escape characters, and provides examples of C programs.

Uploaded by

umamucheli34
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

Java

=====
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

Programming language divided into two types.

1)Low Level Language

2)High Level Language

1)Low Level Language


---------------------
A language which is understand by a computer easily is called low level language.

A language which is computer dependent is called low level language.

ex:
Machine Language
Assembly Language

Machine Language
-----------------
It is a fundemantal language of a computer which is combination of
0's and 1's.

It is also known as binary language.


Our computer may understands many languages but to understand machine language
computer does not required any translator.

Advantages:

> A program writtens in machine language consumes less memory.

> It does not required any translator.

> It is more efficient when compare to other languages.

Disadvantages:

> It is a burdun on a programmer to remember dozen's of binary code.

> Whenever error raised in our program then locating and handling that error
becomes difficult.

> Modifications can't be done easily.

Assembly Language
-----------------
The second generation language came into an existence is called assembly language.

Assembly language is a replacement of symbols and letters for mathematical


programming code i.e opcode values.

It is also known as symbolic language.

Assembly language can't understand by a computer directly.We required translator.

We have three translators.

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.

> Modifications can be done easily.

Demerits:

> It is a mind trick to remember symbolic code.

> It requires translator.


> It is less efficient when compare to machine language.

Q)What is Debugging?

Bug is also known as Error.

The process of eliminating the bugs from the application is called debugging.

2)High level language


---------------------
A language which is understand by a user easily is called high level language.

A language which is user dependent is called high level language.

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:

> It is easy to learn and easy to use because it is similar to english


language.

> Debugging can be done easily.

> Modifications can be done easily.

Disadvantages:

> It requires translator.

> A program writtens in high level language consumes huge amount of memory.

> It is not efficient when compare to low level language.

Types of IT companies
======================

1) Service Based companies


---------------------------
Companies those who provides services to client/customer.
ex:
Cognizent, Capgemini, TCS and etc.

2) Product Based companies


-----------------------
Companies those who have their own products to sell in the market.
ex:
Oracle Corporation, Microsoft, Amazon and etc.

Escape Characters / Escape Sequences


====================================
Escape characters are used to design our output in neat and clean manner.

Every escape character starts with back slash(\) followed by a character.


ex:
\n

Mostly every escape character is placed inside output statement in java.


ex:
System.out.println("\n");

We have following list of escape characters in java.

1) \n (new line)

2) \t (horizontal tab)

3) \b (back space)

4) \r (carriage return)

5) \f (form feeding)

6) \\ (back slash)

7) \" (double quote)

8) \' (single quote)

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

7) \" (double quote)


----------------------
class Chandu
{
public static void main(String[] args)
{
System.out.println("IHUB\"TALENT");
}
}
o/p:
IHUB"TALENT

8)\' (single quote)


-------------------
class Doni
{
public static void main(String[] args)
{
System.out.println("IHUB'TALENT");
System.out.println("IHUB\'TALENT");
}
}
o/p:
IHUB'TALENT
IHUB'TALENT

C program
=========

Q)Write a c program to display %d ?

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

You might also like