Wednesday, April 21, 2021

Future Of Electric Cars

Future Of Electric Cars

 

Future of Electric Cars 

Electric Cars

Hello guys welcome to my blog World Of Electrical Engineering. We discuss the future of Electric Cars in this article.

We all know that the future of Electric Cars is much brighter in next decades and many wide job scopes for electical engineer in future.

Now a days craze of Electric Cars is grow more and more world wide. But in present the growth of Electric Cars is just begin.


Points to be discuss in this Article is mentioned below:

Tuesday, November 5, 2019

Data Types In JAVA

Data Types In JAVA

Data Types In JAVA | JAVA Programming Language


Java data types
Data Types In JAVA Programming Language


Data Types in Java


Data types specify the different sizes and values which can be stored in the variable.

There are two types of data types available in Java Programming Language:

1. Primitive Data Types
2. Non Primitive Data Types


  • 1. Primitive Data Types

The primitive data types consists boolean, char, byte, short, int, long, float and double.


  • 2. Non-primitive data types: 

The non-primitive data types consists Classes, Interfaces, and Arrays.


Java Primitive Data Types


In Java Programming language, primitive data types are the building blocks of data manipulation. These are the very basic data types available in Java programming language.

There will be 8 types of primitive data types are available in Java Programming language

  • 1. boolean data type
  • 2. byte data type
  • 3. char data type
  • 4. short data type
  • 5. int data type
  • 6. long data type
  • 7. float data type
  • 8. double data type

All the primitive data types are explained below:


  • 1. Boolean Data Type

The Boolean data type is the data type which used to store only two possible values: first true and second false. Boolean data type is used for simple flags which track true/false conditions.

The Boolean data type consider one bit of information, but its size can not be defined precisely.


  • 2. Byte Data Type

The byte data type is one of the example of primitive data type. Which is an 8-bit signed 2's complement integer. 


Byte data type value-range varied between -128 to 127 (inclusive). The minimum value of byte data type is -128 and the maximum value of byte data type is 127. That's default value is 0.


The byte data type is used for save memory in large arrays where the savings of memory is must required. This data type saves space because a byte is 4 times smaller than an integer. Byte data type can also be used in place of "int" data type.


  • 3. Short Data Type

The short data type is a 16-bit signed 2's complement integer. The value range of short data type is lies between -32,768 to 32,767 (inclusive). 


The minimum value of short data type is -32,768 and maximum value of short data type is 32,767. The Default value of short data type must be 0.


We can also use the short data type to save memory as like byte data type. The short data type is 2 times smaller than an integer data type.


  • 4. Int Data Type

The int data type is primitive data type and also a 32-bit signed 2's complement integer. Its value-range varies between - 2,147,483,648 (-2^31) to 2,147,483,647 (2^31 -1) (inclusive).


The minimum value of int data type is - 2,147,483,648 and maximum value of int data type is 2,147,483,647. In int data type"0" is used as a default value.


We should used the int data as a default data type for integral values unless if there is no problem about memory.


  • 5. Long Data Type

The long data type is a 64-bit 2's complement integer. The value range of long data type is varies between -9,223,372,036,854,775,808(-2^63) to 9,223,372,036,854,775,807(2^63 -1)(inclusive).


The minimum value of the long data type is - 9,223,372,036,854,775,808 and the maximum value of long data type is 9,223,372,036,854,775,807. 


Default value of the long data type is 0. The long data type is used when we need such a range of values more than those provided by int.


  • 6. Float Data Type

The float data type is a data type which is also known as a single precision 32-bit IEEE 754 floating point. The value range of float data type is unlimited. 

This data type is allowed to use a float (instead of double) if we need to save memory in large arrays of floating point numbers. The float data type is never be used for precise values, as like currency. The Default value of float data type is 0.0F.


  • 7. Double Data Type

The double data type is the data type which is also called a double precision 64-bit IEEE 754 floating point. The value range of double data type is unlimited. 


The double data type is mostly used for decimal values as like float data type. The double data type does not used for precise values, as like currency. In double data type "0.0d" is the default value.


  • 8. Char Data Type

The char data type is the data type which is known as a single 16-bit Unicode character. 


The value range of char data type is varies between '\u0000' (or 0) to '\uffff' (or 65,535 inclusive). It also used to store characters.


Java Non Primitive Data Types


Non-primitive data types are known as the data type which is created by programmers. These data types are not predefined in Java as like primitive data types. 


If we define a variable of non-primitive data types, then it references a memory location where data is stored in the heap memory. Such that it references to a memory where an object is actually placed.


So, the variable of a non-primitive data type is also known as reference data types also called a object reference variable. This reference data types available in the stack memory and the object  which it points always lives on the heap memory. The stack stay holds a pointer to the object on the heap.


In Java programming language, all non primitive data types are known as objects which are created by instantiating a class.


There will be mainly 5 types of Non Primitive Data Types are available:

  • 1. Class
  • 2. Object
  • 3. String
  • 4. Array
  • 5. Interface

The description of all the five non primitive data types are explained below:


  • 1. Class and objects: 

Every class is data type and it is also considered as user defined data types. This can be possible because of a user creates a class.

  • 2. String: 

A string which represents the sequence of characters like America, DEF456, etc. A simplest way of to create a string object which is possible by storing sequence of characters into string type variable as like this:

          String str="Apple";

Here, A string type variable str contains "Apple". A string is also called a class.


  • 3. Array: 

An array in java is one of the object which is used to store same type multiple variable. That variables can be primitive or non-primitive data type.

 
To declaring an array variable of primitive data type int is shown below:

           int [ ] runs;

To declaring an array variable of non primitive data type is shown below:

          Animals [ ] animals; // animals is a name of class.

  • 4. Interface: 


The interface is declared as like a class but one of the difference is that interface contains only final variables and method declarations. Interface is the fully abstract class.


Friday, October 25, 2019

What is Inheritance ? | Concept of inheritance in JAVA | JAVA Programming

What is Inheritance ? | Concept of inheritance in JAVA | JAVA Programming

What is Inheritance ? | Concept of inheritance in JAVA | JAVA Programming




What is Inheritance?


In this article we learn about inheritance in java with the help of simple examples.


Inheritance is the one of the part of or key features of object oriented programming (OOP) which allows us to define a new class from an existing class.

Example:

class Birds
{
          // eat() method
          // sleep() method
}
class Parrot extends Birds
{
          // fly() method
}


In Java Programming, we can use the extends keyword to inherit from a class.


Here, we have inherited the parrot class from the Birds class.


The Birds is the super or parent class and the parrot is a subclass or child class.


The subclass inherits the fields and methods of the super class.




is-a relationship


Inheritance is the one type of is-a relationship. We can use inheritance if and only if an is-a relationship is present between two classes.

Example:

A mango is a fruit.
A bus is a vehicle.
A parrot is a bird.
A cat is a animal.
A Neem is a tree.
A fan is an object.


Example of JAVA Inheritance:

class Birds
{
          public void eat()
          {
                    System.out.println( " I can eat " );
          }
          public void sleep()
          {
                    System.out.println( " I can sleep " );
          }
}

class Parrot extends Birds
{
           public void fly()
           {
                     System.out.println( " I can fly " );
           }
}

class main
{
          public static void main ( string[ ] args )
          {
                    Parrot.parrot1 = new Parrot();
                    
                    parrot1.eat();
                    parrot1.sleep();

                    parrot1.fly();
          }
}

Output:

I can eat
I can sleep
I can fly


In this example we have inherited a subclass Parrot from superclass Birds. 

The Parrot class inherits the methods eat() and sleep() from the Birds class.

So, object of the Parrot class can access the members of both the Parrot class and the Birds class.



Types of inheritance


There are five types of inheritance.

1. Single inheritance:

In this type of Inheritance Class B applies only to Class A.


2. Multi-level inheritance

In multi level inheritance class B extends class A;  then class C extends from class B.

 3. Hierarchical inheritance: 

In Hierarchical inheritance Class A acts as a superclass for classes B, C and D.


 4. Multiple inheritance:

In Multiple inheritance Class C extends from interfaces A and B.

 5. Hybrid inheritance

It is a combination of two or more types of inheritance.


Java programming should not support multiple and hybrid inheritance through classes. Also we can get multiple legacy in Java via interfaces.



Why use inheritance?

The most important use is the reuse of the code. The code in the parent class does not need to be rewritten in the child class.

To get run-time polymorphism by overloading a method.  We will learn more about polymorphism in future article.

Wednesday, October 23, 2019

What is OOPS ? | Concept of OOPS | JAVA programming

What is OOPS ? | Concept of OOPS | JAVA programming

What is OOPS ? | Concept of OOPS | JAVA programming


JAVA programming

What is OOPS?

Object-oriented programming is a programming concept based on the principle that objects are the most important part of your program.  


Lets users create the desired objects and then create methods to manage those objects.  Handling these objects for results is the goal of object-oriented programming.


Object-oriented programming, better known as OOP, is used in a modern programming language such as Java.


The basic concepts of OOPS are

(1) Class


The class is a group of similar entities.  It's just a logical component and not the physical entity.  

For example, 

if you have a class called Costly Cars, it may include items such as Mercedes, BMW, Toyota, etc.  Their characteristics (data) can be the price or the speed of these cars.  While methods can be done with these cars, drive, reverse, brake, etc.


(2) Object


An object can be defined as an instance of a class and a program can contain multiple instances of a class.  


An object contains both the data and the function that works with the data.  

For example

chair, bike, marker, pen, table, car, etc.


(3) The Inheritance


Inheritance is an OOPS concept in which an object captures the properties and behavior of the parent object.  

A parent-child relationship is established between two classes.  It provides a robust and natural mechanism for organizing and structuring any software.


(4) Polymorphism


Polymorphism refers to the ability of a variable, object, or function to take many forms.  

For example, 

In English, the verb has a different meaning when you use it with a laptop, a race and a company.  


Here we understand the term meaning based on the other words used together with term.  The same is true for polymorphism.


(5) Abstraction


An abstraction consists in presenting the essential characteristics without taking into account the details of the background. This is a technique for creating a new data type that is suitable for a particular application.  

For example, 

If you drive a car, you do not have to worry about internal work.  Here, you only need to worry about parts such as the steering wheel, the transmission, the accelerator pedal, and so on.


(6) Encapsulation


Encapsulation is a OOP technique for encapsulating data and code.  In this OOPS concept, variables in one class are always hidden from other classes.  


It could only be accessed using the methods of their current class.  


For example, 

At school, a classless student can not exist.


(7) Association


Association is a relationship between two objects.  It defines the diversity between objects.  


In this OOP concept, all objects have a distinct life cycle and there is no owner.  


For example, many students may be assigned to one teacher, while one student may be assigned to more than one teacher.


(8) Aggregation


In this technique, all objects have their own life cycle.  However, there are property rights so that children can not belong to any other parent.  


For example, consider the class / object department and the teacher.  Here, only one teacher can not belong to more than one department, but even if we delete the department, the teaching object is never destroyed.


(9) composition


A composition is a particular form of aggregation.  It is also called "relationship of death".  Child objects do not have a life cycle.

If the parent object deletes all child objects, they will also be deleted automatically. Take an example of the house and the room. Each house can have several rooms.  


A room can not be part of two different houses.  So if you delete the house, the room will also be deleted.


Benefits of OOPS:


✓ OOP provides a clear and easy-to-understand modular structure for programs.

✓ Objects created for object-oriented programs can be reused in other programs. This saves considerable development costs.

✓ Large programs are hard to write, but if the development and design team follows the OOPS concept, they can design better with minimal errors.

✓ This also improves the modularity of the program because each object exists independently.

Friday, October 18, 2019

Java Programming interview questions

Java Programming interview questions

Java Programming interview questions


Java Programming Interview Questions

Here we provide most asked interview questions which is more helpful to crack  any interview of java programming.


1. What is JVM?  Why is Java called a platform-independent programming language?Guess?


Ans.


A Java Virtual Machine (JVM) is a virtual process engine that can execute Java bytecode.  


Each Java source file is compiled

into a bytecode file executed by the JVM. Java has been designed to enable the creation of application programs that are possible
Run on any platform without the programmer having to rewrite or compile it for each platform.  

A virtual Java Machine makes this possible because it knows the specific command lengths and other peculiarities of the underlying Hardware platform.




2. What are the difference between JDK and JRE?


Ans.


The Java Runtime Environment (JRE) is basically the Java Virtual Machine (JVM) that runs your Java programs.


It also contains browser plugins for running applets. The Java Development Kit (JDK) is fully functional software development Kit for Java, including JRE, compilers and tools (such as JavaDoc and Java Debugger for a user to develop and compile Run Java applications.




3. What does the keyword "static" mean? Should we override private or static Method in Java?


Ans.


The static keyword indicates that a member variable or method can be accessed without requiring instantiation of the class what it belongs.  A user can not override static methods in Java because overriding methods is based on dynamic binding.


Runtime and static methods are statically bound during compilation. The Static method is not associated with any instance of a class

So the concept is not applicable.



4. Can you access non-static variables in the static context?


Ans.


A static variable in Java belongs to its class and its value remains the same for all instances.  A static variable is initialized

when the class is loaded by the JVM.  

If your code attempts to access a non-static variable without an instance, the compiler will do it Complain because these variables have not yet been created and are not associated with any instances.

Sunday, October 13, 2019

What is cloud computing ?

What is cloud computing ?

What is cloud computing ?

The technology moves more and more into the cloud.  It is not just a fad, the shift from traditional software models to Software as a Service has steadily gained momentum over the past 10 years.

Looking ahead, the next decade of cloud computing promises even more opportunities to collaborate from anywhere with mobile devices.

What is cloud computing
What is cloud computing ?

What is Cloud Computing?


Cloud computing is essentially a kind of outsourcing of software, data storage and processing. Users access applications and files by signing in from any device that has an Internet connection.

Information and programs are hosted by third parties and are not on the user's hard drive but in a global network of secure data centers.

This saves computing power, facilitates sharing and collaboration, and enables secure mobile access, no matter where the user is or what device is being used.

Cloud computing is a more efficient way to deploy computer resources.  In cloud computing, software and service environments are based on subscriptions-users pay a monthly fee instead of buying licenses.

Software and platforms are maintained by providers and continually updated to ensure maximum performance and security.

Computing power is not central, but decentralised, so users can leverage additional capacity when business issues arise.  Multiple people can access a shared program or file and collaborate in real time from multiple locations.

Younger employees have a hard time imagining that employees could only access work files, messages, and systems connected to other computers on the network by physical cables from a single terminal in the office in a given time.  

The software had to be manually installed on each computer.  Company data was stored on large machines in a room or cabinet that had to be well ventilated to prevent overheating.  The loss or failure of a single device can be catastrophic.

Cloud computing has optimized or eliminated many previous Office features:


Large server companies no longer need to place server benches in well-ventilated cabinets or equipment rooms.

  • Dedicated in-house IT support - 

Technology talents continue to be valued, but companies no longer need corporate staff to troubleshoot their hardware and software systems.  Cumbersome tasks such as updating computers one by one have been eliminated.

  • Data Storage Devices - 

Employees do not need to back up data on hard drives, discs, or external devices manually.

  • Limited geographic access - 

Employees and managers are no longer tied to the office.  You can be just as productive on the move or remotely as in the corporate office.  Access to processes and information is not tied to a specific geographic location.

  • Outdated Standard Software - 

Software updates required significant spending every few years to buy the latest version of important programs.  Applications had to be manually installed and maintained on each device.  

Only the largest companies could hire developers to create custom software.  Bugs and security issues may not be resolved for years.

  • Loss of Information - 

Managers feared that in an emergency or natural disaster, all company records could be deleted.  Data stored locally on office computers is prone to loss or failure.  However, data stored in the cloud is protected multiple times.

  • Duplicate Document Versions -

Employees no longer need to e-mail files because one person makes changes and different versions of work products are stored locally on multiple devices.  

Cloud-based shared files are always up to date. Colleagues can be sure that they all see the same and work with the same information.

In the Traditional business applications have always been complicated and expensive. The amount and variety of hardware and software required to run them was tremendous. 

Businesses needed a whole team of experts to install, configure, test, run, secure, and update.

If you spread that effort across dozens or hundreds of apps, it's easy to see why in the past, only the largest companies with the best IT departments received the custom solutions they needed.  

Small and medium businesses did not stand a chance.  Advances in cloud computing have changed this.

Cloud computing: 

Cloud computing eliminates the headaches associated with storing your own data by not managing hardware or software.  This is the responsibility of an experienced provider like Salesforce.  

The shared infrastructure works like a utility: you only pay for what you need, upgrades are automatic, and scaling is easy.

Cloud-based apps can run in days or weeks and cost less.  With a cloud app, you simply open a browser, log in, customize the app, and start using it.

Why cloud computing is better:


  • Accessible from anywhere - 

applications and data are not tied to a device. They are accessible from any location and allow remote teams to collaborate in real time.

  • Flexible and Scalable - 

Cloud-based applications are infinitely customizable.  It's easy to increase performance, storage, and bandwidth as users' needs change.

  • Affordable - 

Companies pay only for what they consume, usually per month per seat.  There is no hardware that consumes 24/7 space and consumes power.

  • Hassle-free updates - 

The web-based software is constantly updated.  The provider takes care of maintenance, backups and troubleshooting.

Fast service is delivered on demand through a global network of secure data centers that are constantly updated to provide maximum efficiency and performance.

  • Safe - 

Information is not prone to flooding, fires, natural disasters, or hardware outages in one place.  Security logs and infrastructure are constantly being analyzed and updated to meet new threats.

Businesses run all kinds of apps and many things in the cloud, such as:  B. Customer Relationship Management (CRM), human resources, accounting and much more.

Salesforce was a pioneer in delivering cloud-based software.  Some of the world's largest companies have moved their applications to the cloud with Salesforce after thoroughly testing the security and reliability of our infrastructure.

A word of caution

As cloud computing becomes more popular, thousands of businesses simply rename their non-cloud products and services as "cloud computing." 

As you evaluate cloud offerings, think deeper and remember that you need to buy and manage hardware and software what you are looking for is not really cloud computing but a bad cloud.

  

Tuesday, October 8, 2019

What is JAVA ? | History Of JAVA | Features Of JAVA

What is JAVA ? | History Of JAVA | Features Of JAVA

History of Java / Core Java


JAVA Programming Language



Java Programming Language, was invented by James Gosling under Sun Microsystem company.


But both Mike Sheridan and Patrick Naughton have a big stake in making Java language.  In all three, 'James Gosling' played an important role.


Java language was originally created for the interaction of Television.  But currently this language proved to be very important and in future its importance will increase even more.


Java was first named 'Oak' from this tree.  This means 'James Gosling' and his co-workers used to work for Java, there was 'Oak' tree and 'Oak' is also the national tree of many countries.  That's why it was named 'Oak'.


This 'Oak' was named in 1991.  But this 'Oak' name was already from 'Oak Technologies'. After that, 'Oak' was renamed 'Java'.


Java was the only reason to name it, that when 'James Gosling' and his co-operatives worked, they used to drink Indonesian coffee of 'Java' seeds and the name 'Java' was quite new too.  That's why Java was named.


In 2010, Sun Microsystem sold it to 'Oracle'.


When java started, its first specimen came in '1995'.



All versions of Java are shown below.



Java versions
JAVA versions



Introduction for Java / Core Java



What is java


Java is a very popular programming language worldwide.

Three variants have been created for Java.

✓ Java SE (Standard Edition)

✓ Java EE (Enterprise Edition)


✓ Java ME (Micro Edition)


1. Java SE

Java SE is used for Basic Programming, also known as Core Java.

2. Java EE

Java EE is Advanced Programming, it is also called Advanced Java.

3. Java ME

Java ME is suitable for mobile programming, but it has no relation with android.


Java was made free when it was launched and will remain free in present and future.  


Another importance of Java is Write Once, Run Anywhere, which means it is run on any mobile-based, windows-based and web-based application.



Java features



Features Of JAVA


Java is designed for Programming with many features.

 Like,

✓ Simple

✓ Secure

✓ Object-oriented

✓ Independence

✓ Portable

✓ Robust

✓ Interpreted

 ✓ Multitreaded

 ✓ High performance

✓ Distributed


Simple: 



This is somewhat similar to Language C ++.  Any user who gets good knowledge from C ++, also has no problem in learning Java.



Secure: 



It is more secure than Language C and C ++.  This is Language virus-free Language.



Object-Oriented: 



It is Language Class-based and Object-based.



Independent: 



It is independent language, if you want to build a software, then it does not need anything.


Portable: 



This language can be run on any platform.



Robust: 



This language and its memory management are very strong.



Interpreted: 



This language is an interpreted language.



Multitreaded:



More than one program can be run simultaneously in this language.



High Performance: 



Compilers of Java do not take much time for program execution, hence it is considered a high-performing language.



Distributed: 



The program created by Java is distributed from one computer to another.