Monday, 6 November 2017

Java : Java Editions

JDK 1.0
Code name Oak and released on January 23, 1996
JDK 1.1
Released on February 19, 1997

J2SE 1.2
Code name Playground and released on December , 1998

J2SE 1.3
Code name Kestrel and released on May 8, 2000

J2SE 1.4
Code name Merlin and released on February 6, 2002

J2SE 5.0
Code name Tiger and released on September 30, 2004

J2SE 6
Code name Mustang and released on December 11, 2006

J2SE 7
Code name Dolphin and released on July 28, 2011

J2SE 8
Code name Spider and released on March 18, 2014

J2SE 9
Released on September 21, 2017

Sunday, 5 November 2017

Java : History of Java and Features of Java

History of Java
The history of Java starts from Green team. Java team members also known as Green Team, initiated a task to develop a language for digital devices such as set-top boxes, televisions etc.
James Gosling, Mike Sheridan and Patrick Naughton initiated the Java language project in June 1991. The small team of Sun engineers called Green Team.
Firstly it was called Greentalk by James Gosling and file extension was .gt.
After that, it was called Oak. Oak is symbol of strength and chosen as national tree of many countries like U.S.A., France, Germany, Romania etc.
In 1995, Oak was renamed as Java because it was already a trademark by Oak Technologies.
Java was originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems’ Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.

Features of Java
Simple :
Java language is simple because its syntax is based on C++. If you already understand the basic concepts of object-oriented programming, learning Java will be even easier. If you are experienced C++ programmer, then moving to Java will require very little effort. Because Java inherits the C/C++ syntax and many of the object-oriented features of C++.

Object-oriented :
Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behavior. All program code and data reside within object and classes. The object model in Java is simple and easy extend.

Secure :
Java does not allow one to directly access and manipulate the computer memory as the case in C or C++ with the use of pointers. The use of pointers can provide speed but some time prove dangerous of direct memory manipulation of memory addresses.
Java programs run inside virtual machine sandbox.
A Java sandbox is an area inside the memory. Outside which a Java program can’t make calls to Java resources such as APIs. Java sandbox consists of three components.
Classloader : It adds security by separating the package for the classes of the local file system from those that are imported from network sources.
Bytecode Verifier : It checks the code fragments for illegal code that can violate access right to objects.
Security Manager : It determines what resources a class can access such as reading and writing to the local disk.

Portable :
Java programs can be easily moved from one computer to another. Java compiler generates byte code instruction, we may carry the java byte code to any platform.

Robust :
Robust means strong. Java uses a strong management. Java provides exception handling to manage errors. To gain reliability, java has strict compile time and run time checking for codes. To better understand how java is robust, consider two main reasons for program failure: memory management mistakes and mishandled exceptional conditions.

Multithreaded :
A thread is like a separate program. We can write Java programs that deal with many tasks at once by defining multiple threads. The main advantage of multi-threading is that it doesn’t occupy memory for each thread. It shares common memory area.

Architecture-neutral :
There is no implementation dependant features e.g., size of primitive data types is fixed.
In C language, int data type occupies 2 bytes of memory for 32-bit architecture and 4 bytes of memory for 644-bit architecture. But in Java, it occupies 4 bytes of memory for both 32 and 64 bit architectures.

Interpreted:
Usually a computer language is either compiled or interpreted. Java combines these approaches thus making Java a two-stage system. Java compiler translates source code into byte code instruction. Byte codes are not machine instructions and so java interpreter generates machine code that can be directly executed by the machine that is running the java program. So we can say that java is both a compiled and an interpreted language.

High performance:
Java is faster than traditional interpretation since byte code close to native code.

Distributed:

We can create distributed applications in java. Java is designed for the distributed environment of the Internet, because it handles TCP/IP protocols. Java also supports Remote Method Invocation (RMI). This feature enables a program to invoke methods across a network. 

Whatsapp Tricks : Font Formating like bold, italic, strikethrough


Friends,

In Whatsapp you can send message in bold, italic and strikethrough fonts. If you want to highlight some text then this trick can be used.
Suppose you want to write a message like "Have a nice day". Here in this message "nice" is in bold one.
For that you have to type in whatsapp like
Have a *nice* day.
Means the text you want to bold should be enclosed within "*".

Same way if you want to show in italic then the text should be enclosed within "_" underscore.

And if you want to strike out some text then that text should be enclosed within "~".

Wednesday, 30 July 2014

Display sum of first n positive nos.

#include<stdio.h>
#include<conio.h>
void main()
{
        int i, n, sum=0;
        clrscr();
printf(“Enter total no. to sum : ”);
scanf(“%d”, &n);
for(i=1;i<=n;i++)
{
                sum=sum+i;
}
printf(“Sum of first %d nos. is %d”, n,sum);
getch();
}


OUTPUT :
Enter total no. to sum : 10

Sum of first 10 nos. is 55

Monday, 28 July 2014

Write a program to enter a no. and check it is palindrome prime or not.

#include<stdio.h>
#include<conio.h>
void main()
{
        int i, n, on, rem, revno=0, k=1;
        clrscr();
printf(“Enter any no. : ”);
scanf(“%d”, &n);
for(i=2;i<=n/2;i++)
{
if(n%i==0)
                {
                                k=0;
                                break;
}
}
on=n;
while(n>0)
{
                rem=n%10;
                revno=(revno*10)+rem;
                n=n/10;
}
if(revno==on && k==1)
printf(“%d is a palindrome prime no.”, on);
else
printf(“%d is not a palindrome prime no.”, on);
getch();
}
OUTPUT :
Enter any no. : 131

131 is a palindrome prime no.

Tuesday, 3 December 2013

Important questions of C language BCA-1
Q. 1        Explain C Program structure.
Q. 2        Explain variable naming rules and scope of variable.
Q. 3        List out various operators available in C. Explain any three.
Q. 4        Explain data types available in C.
Q. 5        Explain pre-processor directives.
Q. 6        List out selective control structures. Explain any one with example.
Q. 7        What is loop ? How many loops are there in C? Explain any one with example.
Q. 8        Explain jumping statements. (break, continue, goto)
Q. 9        Explain any five string handling functions.
Q. 10      Explain I/O formatting functions.
Q. 11      Difference between malloc() and calloc().
Q. 12      What is UDF? Write down  its types. Explain any one with example.
Q. 13      What is array? List out its types. Explain any one with example.
Q. 14      Explain initialization and working with array.
Q. 15      Explain declaration and definition of structure.
Q. 16      Explain pointer to structure.
Q. 17      Difference between structure and union.
Q. 18      What is pointer? Explain pointer to array.

Q. 19      Explain following functions : fopen, fprintf, fscanf,  fseek, ftell, fclose.

Thursday, 22 August 2013


Problem Solving Methodologies and Programming in C
MCQ and short questions of Chapter 4

1. What is the use of getchar()?
(A) Get one character from keyboard (B) Get many character from keyboard
(C) Get one digit from keyboard (D) Get many digits from keyboard
2. What is the use of putchar()?
(A) Display one character onto screen (B) Display many character onto screen
(C) Display one digit onto screen (D) display many digits onto screen
3. What is the use of pow()?
(A) x^y (B) x*x (C) x/y (D) x%y
4. What is the use of sqrt()?
(A) Square root of any number (B) Multiplication of any number
(C) Cube of any number (D) Modulo division of any number
5. Which function is used for taking float number remainder?
(A) fmod() (B) fabs() (C) floor() (D) ceil()
6. What is the use of gets() in program?
(A) get only one character (B) get only one line
(C) get only one word (D) get strings
7. What is the use of getch() in program?
(A) see output (B) get only one character
(C) get only one word (D) by default in program
8. What is the limitation of getch()?
(A) not echo the character (B) not get the character
(C) not get the word (D) not get the line
9. What is the use of getche() in program?
(A) get only one character (B) get only one line
(C) get only one word (D) None of these
10. What is the use of strcmp() in program?
(A) strings compare (B) strings copy (C) strings concatenatess (D) strings compile
11. What is the use of strncat() in program?
(A) no. of strings compare (B) no. of strings copy
(B) no. of strings concatenatess (D) no. of strings compile
12. Which header file is required for string handling function?
(A) string.h (B) stdlib.h (C) ctype.h (D) stdio.h
13. Which header file is required for character function?
(A) string.h (B) stdlib.h (C) ctype.h (D) stdio.h
14. Which header file is required for delay()?
(A) process.h (B) dos.h (C) stdio.h (D) conio.h
15. How many types of functions are available in C?
(A) 1 (B) 2 (C) 3 (D) 4
16. How many type of user defined function are in C ?
(A) 1 (B) 2 (C) 3 (D) 4
17. What is the other name of function header part?
(A) function signature (B) function name (C) function body (D) function arguments
18. When we make a mistake in function name in definition that time which error is generate?
(A) function name wrong (B) function header wrong
(C) function prototype (D) function signature wrong
19. In main(), when any function is call, that parameter is known as :
(A) formal argument (B) actual argument (C) not define (D) normal arguments
20. When one function is call itself that is known as:
(A) nested function (B) recursive (C) itself call (D) simple call
21. Which data type return by main function by default?
(A) char (B) int (C) float (D) double
22. How many values can return by function?
(A) 1 (B) 2 (C) 3 (D) 4
23. When function call other function that is known as :
(A) nested function (B) recursive (C) itself call (D) simple call
24. Which data type is used when function not return any value?
(A) char (B) int (C) float (D) void
25. What is the scope of global variable in program?
(A) Only one function (B) Within one function (C) Two functions (D) Entire program
26. When return statement is required in program?
(A) Function return data type void (B) Function should return value
(C) Function not return any value (D) None of these
27. What is optional in function prototype declaration?
(A) variable name (B) data type (C) semi colon (D) function name
28. What values are pass in call by reference technique?
(A) original values (B) formal values (C) address of variable (D) other
29. What is the name in function definition user gives the arguments?
(A) Actual arguments (B) Formal arguments (C) Simple arguments (D) Multi Arguments
30. When large program devide in more that sub program known as....
(A) sub program (B) sub function (C) multifunction (D) nested function
31. Every string terminates with which character?
(A) /0 (B) '0' (C) \0 (D) "0"

1. Write down types of functions.
2. What is the extension of header file?
3. What is the full form of UDF?
4. What is the use of strcpy()?
5. What is the use of strncpy()?
6. What is the use of strcat?
7. What is the use of strncat()?
8. What is the use of strlen()?
9. What is the use of strcmp()?
10. What is the use of strncmp()?
11. What is the use of strrev()?
12. To use printf() function which header file should be used?
13. To use scanf() function which header file should be used?
14. To use clrscr() function which header file should be used?
15. To use getch() function which header file should be used?
16. To use UDF in C program which components should be used?
17. How many ways we can call a function?
18. What is recursive function?
19. Write down types of UDF?
20. What is the other name of Library function or Built-in function?

     Best of Luck