Showing posts with label Technical News. Show all posts
Showing posts with label Technical News. Show all posts

What are the OOPS concepts.

The following four are the important OOPS concepts.

Abstraction:

Abstraction is nothing but a exposing only important feature without inside functionality.

Encapsulation:

Encapsulation is a system utilized for concealing the properties and practices of an object . It keeps different objects from straightforwardly modifying or getting to the properties or strategies for the encapsulated object.

Inheritance:

Inheritance is one of the excellent assert of Object-Oriented Programming. It permits a class to utilize the methods and properties  for another class.

The determined class acquires the behavior of the base class. The determined class is likewise called subclass and the base class is otherwise called super-class.

The determined class can include its own particular extra factors and techniques. These extra factors and strategies separates the derived class from the base class.

And Inheritance is a run time system. A super-class can have any number of subclasses. In any case, a subclass can have just a single super class. This is on the grounds that Java does not bolster numerous legacy.


The superclass and subclass have "is-a" connection between them. The following is the syntax.

class classB extends Class A 
{  
   //methods and fields  
}  

Polymorphism:

Polymorphism in Java is an idea by which we can play out a solitary activity by various ways.
There are two sorts of polymorphism in Java as follows.


  1.  Compile time polymorphism
  2.  Runtime polymorphism 

By using two strategies we can perform polymorphism in Java there are over-loading and over-riding. On the off chance that you over-burden static technique in Java, it is the case of compile time polymorphism. 

Difference between StringBuffer and StringBuilder?


The both StringBuffer and StringBuilder seem to be sane, but this is one of the irregularly asking interview questions. The following are the some point needs to remember.


  1. StringBuffer is synchronized where as StringBuilder is not synchronized.
  2. StringBuffer is thread safe that means at a time only a single thread is allowed to operate.
  3. StringBuilder is not thread safe that means at a time multiple threads are allowed to operate.
  4. StringBuffer performance is slow when compared to StringBuilder why because a thread has to wait in a StringBuffer.
  5. StringBuffer was introduced in the 1.0 version where as StringBuilder was introduced in 1.5 version.

What is the difference between String and StringBuffer?

This is a common interview question for the fresher as well as experienced persons, here first we need to know what is a string. 


String:



The string can be defined as a sequence of characters. In Java string is immutable that means if you created once that never be modified. The following is an example.

String s=new string("donald")
s.concat("trump")
System.out.println(s)

In the above example, s is pointing to the name donald and where as we creating another one that is trump so the new object donlad trump will be created but is still pointing to the Donald only. Here the output will be donald only.

Where the new object donald trump will be automatically eligible for garbage collector.


StringBuffer:



The StringBuffer is mutable that means we can change the existing object. The following is an example.

Stringbuffer sb=new StringBuffer("donald")
sb.append("trump")
System.out.println(s)

In the above example, the result will be donald trump.



What is the difference between final, finally, finalize() in java?

This is one of the important question, if you attend for 10 interviews at least you will face 5 to 8 times this question.

What is Final?

Final is as modifiers which can be applicable for classes, methods, variables. If we declare variable as final then it becomes Constant that means reassignment is not possible (we cannot change the value). If you declare a method as final as you cannot override that in child class. If you declare a class as final you cannot extend that class means that inheritance is not possible.

What is Finally?

The finally is blocked, which gets executed whether an exception raised or not and it is used to close the connections such as database connection etc.


try
{

//the risky code 

}
catch{

//handling the code

}
finally{

//clean up code

}

What id finalize?

The finalize() is a method which is always invoked by garbage collector just before destroying an object to perform cleanup activities.

Why java is platform independent?


This is one of the important interview questions for the Freshers, we all know that C and C++languages are platform dependent languages whereas Java is a platform independent language. 

Before going to know about this we have to know that what is platform dependent and independent? 

If any coding language which allows its applications to compile and execute in the same operating system then we called as platform dependent. 

                          Ex: C, C++ 

If any coding language which allows its applications to compile and execute in the same operating system as well as other operating system. Then we called as platform independent. 

                         Ex: Java 

Note: JVM is not platform independent. While installing JDK only jvm also installed automatically. When you compile your code, then Java compiler is the responsibility to generate the. class file, this .class file code will be read by the JVM. Here the one important point is that every operating system will have its own JVM and this JVM makes the Java platform independent.

Identity column in SQL

While creating a table if you give identity to any column, then you do not need to pass values to that column they will be generated automatically. For identity we need to provide seed and increment of course they are optional if you do not specify the it will take by default 1.


The following is the table.

create tabel blogger(bloggerid int identity(1,1),name varchar(100))

Now insert the values to the blogger table.

insert into blogger values('sai')
insert into blogger values('sandeep')

Now select the values from the table then you will see that the name sai will have bloggerid 1 and sandeep will have bloggerid 2.

If you are trying to insert the values like below you will get an error. This means that user can not insert values explicitly.

insert into blogger values(1,'sai')

Now if you delete the bloggerid 2 then it will be deleted, but while inserting another value then bloggerid will be 3. If you want to insert explicitly then you need to turn on the identity insert as follows.

SET Identity_Insert tablename ON

In our example, we have created a table blogger, so we need to write the query as follows  by adding column names also.

SET Identity_Insert blogger ON

Now insert the values into the blogger table as follows.

insert into blogger(bloggerid, name) values(2,'dummu')

So here we have inserted values explicitly, now if you want to turn off the identity_insert write the following query.


SET Identity_Insert blogger OFF


Even though if you deleted the values from the table, if you again insert the values, it's count starts from last blogger id. If you want to reset the seed, then use the following command.

DBCC CHECKIDENT(blogger, RESEED, 0)










What is the difference between UNION and UNION ALL ?

This is the common interview question for Freshers not only for database developers, but also for programming developers.


Let us create two simple tables form those tables we can easily find the difference.

Create table blog1(id int, name varchar(100),phno nvarchar(20))
insert values into blog1(1,'sai',12345)
insert values into blog1(2,'sandeep',123456)

Create table blog2(id int, name varchar(100),phno nvarchar(20))
insert values into blog1(1,'kalyan',12345)
insert values into blog1(2,'sandeep',123456)


The difference between UNION and UNION ALL is that UNION does not take duplicate values where as UNION ALL will accept duplicate values.


UNION :


Now execute the following query by using UNION

select * from blog1
union
select * from blog2

Now the result will be as follows. Where duplicates will be removed.

id name phno
1 kalyan 12345
1 sai 12345
2 sandeep 123456

UNION ALL: 


Now execute the following query by using UNION ALL

select * from blog1
union all
select * from blog2

Now the result will be as follows. Where duplicates will be added.

id name phno
1 sai 12345
2 sandeep 123456
1 kalyan 12345
2 sandeep 123456
Here you can check the performance by using execution plan.


Difference between UNION and UNION ALL

  • The union does not take duplicates where as Union All will take duplicates.
  • Union follows a distinct sort that's why Union All is faster than the Union.
  • The Text datatype does not support to the Union, where as Union All will support all the data types.
Note:

While performing Union and Union All the number of  columns should be same in both tables and data types should also be same. 







SEO TOOLS SOURCE CODES

Popular social networking sites in 2017

 1) Facebook
 
1,100,000,000 -  Monthly Visitors (estimated)

All of you know that Facebook is one of the most popular social websites to spread anything, all over the world daily millions of people are using. If you want to check web sites ranking go to Alexa.com  website.

 2) Youtube

1,000,000,000 - Monthly Visitors (estimated)

Many years go people used to watch TV's, but know a people were addicted to youtube that provides
educational tutorials, entertainments, news etc. You can check the social impact on YouTube.

3) Twitter

310,000,000 - Monthly Visitors (estimated)

You can check the following link to know how twitter has changed the world.

How twitter has changed the world?

4) Linkedin

255,000,000 - Monthly Visitors (estimated)

This is one of the most useful social website to communicate with the people. This site permits the user to realize alternative business associates and colleagues whom you already recognize.

5) Pinterest

250,000,000 - Monthly Visitors (estimated)

Pinterest  helps user to  discover and save inventive ideas.


3 popular blogs on the Internet world 2017

The following are the 3 popular blogs on the Internet World 2017

Now days everyone will have a passion to browse new things about lifestyles, marketing strategies, technical things then you supposed to find a good blogs the following are the top rated blogs that provides you best things.

1)   ShoutMeLoud

This blog was invented by Harsh Aggarwal in 2008. This blog gives extraordinary tips to make money by using blogs,  how to start with business etc.

2)  Babble

This provides everything about pregnancy and parenting. It provides baby names and lifestyle modules also.

3)  CopyBlogger

If you want to know about online marketing then this is the best blogger that makes you curious on blogging.

What is Normalization?

Database normalization is a data design and organization process applied to data structures based on rules that help building relational dat...