Weekly Current Affairs Quiz: 31 May to 1 June 2021 for Competitive Exams
Current Affairs
1. New CBI Director
Senior IPS officer Subodh Kumar Jaiswal was on May 25, 2021 appointed as the new CBI director for two years, as per the personnel ministry order. A three-member selection committee led by PM Narendra Modi on May 24, 2021, had shortlisted Jaiswal’s name for the position of director, Central Bureau of Investigation.
Current Affairs Quiz
1. “Action and Investment in Menstrual Hygiene and Health” is the theme of which special day celebrated on May 28?
[A] World Menstrual Hygiene Day [B] World Women Health Day [C] World Personal Health Day [D] World Hygiene Day
There are 14 punctuation marks that are commonly used in English grammar. They are the period, question mark, exclamation point, comma, semicolon, colon, dash, hyphen, parentheses, brackets, braces, apostrophe, quotation marks, and ellipsis.
We will today learn about commonly used punctuations : period, question mark, exclamation point, comma, semicolon, colon, apostrophe and quotation marks
Sentence Endings
Three of the fourteen punctuation marks are appropriate for use as sentence endings. They are the period, question mark, and exclamation point.
Period or full stop (.) is placed at the end of declarative sentences, statements thought to be complete and after many abbreviations.
As a sentence ender: Naman and Vihan went to the market.
After an abbreviation: Her son, Chauhan Jr., was born on Jun. 8, 2008.
2. Question mark (?) is used to indicate a direct question when placed at the end of a sentence.
When did Naman go to school?
3. Exclamation point (!) is used when a person wants to express a sudden outcry or add emphasis.
Within dialogue: “Holy cow!” screamed Jane.
To emphasize a point: My mother-in-law’s rants make me furious!
Comma, Semicolon, and Colon
The comma, semicolon, and colon are often misused because they all can indicate a pause in a series.
4. Comma is used to show a separation of ideas or elements within the structure of a sentence. Additionally, it is used in numbers, dates, and letter writing after the salutation and closing.
Direct address: Thanks for all your help, Siri.
Separation of two complete sentences: We went to the movies, and then we went out to lunch.
Separating lists or elements within sentences: Naman wanted the black, green, and blue pants.
5. Semicolon (;) is used to connect independent clauses. It shows a closer relationship between the clauses than a period would show.
John was hurt; he knew she only said it to upset him.
6. Colon (:) has three main uses. The first is after a word introducing a quotation, an explanation, an example, or a series.
He was planning to study four subjects: politics, philosophy, sociology, and economics.
Apostrophe and Quotation Marks
7. Apostrophe (‘) is used to indicate the omission of a letter or letters from a word, the possessive case, or the plurals of lowercase letters. Examples of the apostrophe in use include:
Omission of letters from a word: I’ve seen that movie several times. She wasn’t the only one who knew the answer.
Possessive case: Sara’s dog bit the neighbor.
Plural for lowercase letters: Six people were told to mind their p’s and q’s.
8. Quotations marks (” “) are a pair of punctuation marks used primarily to mark the beginning and end of a passage attributed to another and repeated word for word. They are also used to indicate meanings and to indicate the unusual or dubious status of a word.
“Don’t go outside,” she said.
Single quotation marks (‘ ‘) are used most frequently for quotes within quotes.
Marie told the teacher, “I saw Marc at the playground, and he said to me ‘Bill started the fight,’ and I believed him.”
Capital Letters:
A capital letters is used:
To begin a sentence.
To begin a proper noun
We always begin a sentence with a capital letter.
̄All proper nouns begin with capital letters too. ̄The letter ‘I’ when written by itself is always a capital letter.
Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which can contain data and code: data in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods)
Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism etc in programming. The main aim of OOP is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function.
Java Classes/Objects
Java is an object-oriented programming language.
Everything in Java is associated with classes and objects, along with its attributes and methods. For example: in real life, a car is an object. The car has attributes, such as model and color, and methods, such as drive and brake.
A Class is like an object constructor, or a “blueprint” for creating objects.
What is a Class?
A class is a blueprint or prototype that defines the variables and the methods (functions) common to all objects of a certain kind.
Create a Java Class
To create a class, use the keyword class:
Create a class named “Car” with a variable model and colour:
public class Car{
string model;
string colour;
}
What is an Object?
An object is a representative or specimen of a class. Software objects are often used to model real-world objects you find in everyday life.
Create a JAVA Object
In Java, an object is created from a class. We have already created the class named Car, so now we can use this to create objects.
To create an object of Car, specify the class name, followed by the object name, and use the keyword new:
Car myCar = new Car();
Examples of class and objects
Class
Objects
Fruit
Apple Banana Mango
Car
Volvo Audi Toyota
Examples – Class and Objects
Features of OOPs :
Abstraction
Abstraction is the process of exposing the relevant things and hiding the irrelevant details. The easiest way to understand and appreciate this concept of handling complexity is by studying the example of Globe, a model/prototype of earth that is used by students to understand its geography. Globe provides only that information that is required and if too much of information is mentioned in it i.e. streets, lakes etc, it becomes too complex to comprehend. Hence Globe abstracts unwanted information and makes it easy to comprehend the complex earth.
JAVA Abstract Classes and Methods
Data abstraction is the process of hiding certain details and showing only essential information to the user. Abstraction can be achieved with either abstract classes or interfaces (which you will learn more about in the next chapter).
The abstract keyword is a non-access modifier, used for classes and methods:
Abstract class: is a restricted class that cannot be used to create objects (to access it, it must be inherited from another class).
Abstract method: can only be used in an abstract class, and it does not have a body. The body is provided by the subclass (inherited from).
An abstract class can have both abstract and regular methods:
abstract class Animal {
public abstract void animalSound();
public void sleep() {
System.out.println("Zzz");
}
}
From the example above, it is not possible to create an object of the Animal class:
Animal myObj = new Animal(); // will generate an error
To access the abstract class, it must be inherited from another class. Let’s convert the Animal class we used in the Polymorphism chapter to an abstract class:
Remember from the Inheritance chapter that we use the extends keyword to inherit from a class.
Example
// Abstract class
abstract class Animal {
// Abstract method (does not have a body)
public abstract void animalSound();
// Regular method
public void sleep() {
System.out.println("Zzz");
}
}
// Subclass (inherit from Animal)
class Pig extends Animal {
public void animalSound() {
// The body of animalSound() is provided here
System.out.println("The pig says: wee wee");
}
}
class Main {
public static void main(String[] args) {
Pig myPig = new Pig(); // Create a Pig object
myPig.animalSound();
myPig.sleep();
}
}
Encapsulation
Encapsulation is the mechanism that binds together code and the data it manipulates, and keeps both safe from outside interference and misuse. The data is not accessible to the outside world and only those functions that are wrapped in the class can access it. These functions provide the interface between the object’s data and the program. The insulation of the data from the direct access by the program is called data hiding. In OOP, code and data are merged into an object so that the user of an object can never peek inside the box. This is defined as encapsulation (Object is a capsule encapsulating data and behavior). All communication to it is through messages (function calls which we use to communicate to the object). Messages define the interface to the object. Everything an object can do is represented by its message interface. Therefore, we need not know anything about what is in the object when we use it.
JAVA Encapsulation
The meaning of Encapsulation, is to make sure that “sensitive” data is hidden from users. To achieve this, you must:
declare class variables/attributes as private
provide public get and set methods to access and update the value of a private variable
Get and Set
You learned from the previous chapter that private variables can only be accessed within the same class (an outside class has no access to it). However, it is possible to access them if we provide public get and set methods.
The get method returns the variable value, and the set method sets the value.
Syntax for both is that they start with either get or set, followed by the name of the variable, with the first letter in upper case:
Example
public class Person {
private String name; // private = restricted access
// Getter
public String getName() {
return name;
}
// Setter
public void setName(String newName) {
this.name = newName;
}
}
Example explained
The get method returns the value of the variable name.
The set method takes a parameter (newName) and assigns it to the name variable. The this keyword is used to refer to the current object.
However, as the name variable is declared as private, we cannot access it from outside this class:
Example
public class Main {
public static void main(String[] args) {
Person myObj = new Person();
myObj.name = "John"; // error
System.out.println(myObj.name); // error
}
}
Inheritance
Inheritance is the process by which one class acquires the properties and functionalities of another class. This is important because it supports the concept of hierarchical classification.. Inheritance provides the idea of reusability of code and each sub class defines only those features that are unique to it.
Java Inheritance (Subclass and Superclass)
In Java, it is possible to inherit attributes and methods from one class to another. We group the “inheritance concept” into two categories:
subclass (child) – the class that inherits from another class
superclass (parent) – the class being inherited from
To inherit from a class, use the extends keyword.
In the example below, the Car class (subclass) inherits the attributes and methods from the Vehicle class (superclass):
Example
class Vehicle {
protected String brand = "Ford"; // Vehicle attribute
public void honk() { // Vehicle method
System.out.println("Tuut, tuut!");
}
}
class Car extends Vehicle {
private String modelName = "Mustang"; // Car attribute
public static void main(String[] args) {
// Create a myCar object
Car myCar = new Car();
// Call the honk() method (from the Vehicle class) on the myCar object
myCar.honk();
// Display the value of the brand attribute (from the Vehicle class) and the value of the modelName from the Car class
System.out.println(myCar.brand + " " + myCar.modelName);
}
}
Did you notice the protected modifier in Vehicle?
We set the brand attribute in Vehicle to a protected access modifier. If it was set to private, the Car class would not be able to access it.
Why And When To Use “Inheritance”?
– It is useful for code reusability: reuse attributes and methods of an existing class when you create a new class.
Tip: Also take a look at the next chapter, Polymorphism, which uses inherited methods to perform different tasks.
The final Keyword
If you don’t want other classes to inherit from a class, use the final keyword:
If you try to access a final class, Java will generate an error:
final class Vehicle {
...
}
class Car extends Vehicle {
...
}
The output will be something like this:Main.java:9: error: cannot inherit from final Vehicle class Main extends Vehicle { ^ 1 error)
Polymorphism
Polymorphism is a feature that allows one interface to be used for a general class of actions. An operation may exhibit different behavior in different instances. The behavior depends on the types of data used in the operation. It plays an important role in allowing objects having different internal structures to share the same external interface. Polymorphism is extensively used in implementing inheritance. Ex: add(int a, int b) add(int a, float b, int c) add(int a, int b, float c, double d) Here different datatypes are being added using the same interface.
Java Polymorphism
Polymorphism means “many forms”, and it occurs when we have many classes that are related to each other by inheritance.
Like we specified in the previous chapter; Inheritance lets us inherit attributes and methods from another class. Polymorphism uses those methods to perform different tasks. This allows us to perform a single action in different ways.
For example, think of a superclass called Animal that has a method called animalSound(). Subclasses of Animals could be Pigs, Cats, Dogs, Birds – And they also have their own implementation of an animal sound (the pig oinks, and the cat meows, etc.):
Example
class Animal {
public void animalSound() {
System.out.println("The animal makes a sound");
}
}
class Pig extends Animal {
public void animalSound() {
System.out.println("The pig says: wee wee");
}
}
class Dog extends Animal {
public void animalSound() {
System.out.println("The dog says: bow wow");
}
}
Remember from the Inheritance chapter that we use the extends keyword to inherit from a class.
Now we can create Pig and Dog objects and call the animalSound() method on both of them:
Example
class Animal {
public void animalSound() {
System.out.println("The animal makes a sound");
}
}
class Pig extends Animal {
public void animalSound() {
System.out.println("The pig says: wee wee");
}
}
class Dog extends Animal {
public void animalSound() {
System.out.println("The dog says: bow wow");
}
}
class Main {
public static void main(String[] args) {
Animal myAnimal = new Animal(); // Create a Animal object
Animal myPig = new Pig(); // Create a Pig object
Animal myDog = new Dog(); // Create a Dog object
myAnimal.animalSound();
myPig.animalSound();
myDog.animalSound();
}
}
In procedural programming, program is divided into small parts called functions. Example code : #include <stdio.h> /*this function computes the absolute value of a whole number.*/ int abs(int x) { if (x>=0) return x; elsereturn -x; } /*this program calls the abs() function defined above twice.*/ int main() { int x, printf(” x=”); scanf(“%d”, &x); printf(“Absolute Value of x is %d. \n”, abs(x)); return 0; }
In object oriented programming, program is divided into small parts called objects. Example code :
class Parrot: # class attribute species = "bird" # instance attribute def __init__(self, name, age): self.name = name self.age = age instantiate the Parrot class blu = Parrot(“Blu”, 10) woo = Parrot(“Woo”, 15) access the class attributes print(“Blu is a {}”.format(blu.class.species)) print(“Woo is also a {}”.format(woo.class.species)) access the instance attributes print(“{} is {} years old”.format( blu.name, blu.age)) print(“{} is {} years old”.format( woo.name, woo.age))
Procedural programming follows top down approach. Note: A top-down approach is essentially the breaking down of a program to gain insight into its compositional small program (or module) in a reverse engineering fashion.
Object oriented programming follows bottom up approach. Note : A bottom-up approach is the piecing together of module (or small program) to give rise to more complex program, thus making the original modules of the emergent program.
There is no access specifier in procedural programming.
Object oriented programming have access specifiers like private, public, protected etc.
Adding new data and function is not easy.
Adding new data and function is easy.
Procedural programming does not have any proper way for hiding data so it is less secure.
Object oriented programming provides data hiding so it is more secure.
In procedural programming, overloading is not possible.
Overloading is possible in object oriented programming. Overloading methods lets you define the same method multiple times so that you can call them with different argument lists (a method’s argument list is called its signature)
In procedural programming, function is more important than data.
In object oriented programming, data is more important than function.
Procedural programming is based on unreal world.
Object oriented programming is based on real world.
Data can move freely from procedure to procedure in the system
Objects can move and communicate with each other through member functions
Examples: C, FORTRAN, Pascal, Basic etc.
Examples: C++, Java, Python, C# etc.
Difference between Procedural and Object Oriented Programming
A pronoun is a word used instead of a noun or noun phrase. Pronouns refer to either a noun that has already been mentioned or to a noun that does not need to be named .
The most common pronouns are the personal pronouns, which refer to the person or people speaking or writing (first person), the person or people being spoken to (second person), or other people or things (third person).
Personal Pronouns
There are a number of other types of pronouns. The interrogativepronouns—particularly what, which, who, whom, and whose—introduce questions for which a noun is the answer, as in “Which do you prefer?”
Possessive pronouns refer to things or people that belong to someone. The main possessive pronouns are mine, yours, his, hers, its, ours, and theirs.
The four demonstrativepronouns—this, that, these, and those—distinguish the person or thing being referred to from other people or things; they are identical to the demonstrative adjectives.
Relativepronouns introduce a subordinate clause, a part of a sentence that includes a subject and verb but does not form a sentence by itself. The main relative pronouns are that, which, who, whom, what, and whose.
Reflexive pronouns refer back to the subject of a sentence or clause and are formed by adding -self or -selves to a personal pronoun or possessive adjective, as in myself, herself, ourselves, and itself.
Indefinitepronouns, such as everybody, either, none, and something, do not refer to a specific person or thing, and typically refer to an unidentified or unfamiliar person or thing.
The words it and there can also be used like pronouns when the rules of grammar require a subject but no noun is actually being referred to. Both are usually used at the beginning of a sentence or clause, as in “It was almost noon” and “There is some cake left.” These are sometimes referred to as expletives.
Example:
Ram is a post man. Ram carries letters. To make the second sentence sound better we can change the word Ram to he. Now: Ram is a postman. He carries letters. The word he is a pronoun and that takes the place of Ram
What is an Adjective? Adjective describes a noun hence they are called describing words.They tell us many things about a noun (shape, size, colour, age, number, taste). They tells us how it looks (shape, size and colour ), smells, sounds, feels or tastes. They also tell how many ( number and age )
tasty pizza
blue triangle
The words tasty and blue are describing words and tells us more about the noun.
They can be placed before nouns or after nouns to describe them.
Words which name only ONE person, place, animal or thing are called SINGULAR nouns. Words which name MANY persons, places, animals or things are called PLURAL nouns. Most singular nouns are made plural by simply putting an -s at the end
There are many plural noun rules
1 To make regular nouns plural, add ‑s to the end.
cat – cats
house – houses
2 If the singular noun ends in ‑s, -ss, -sh, -ch, -x, or -z, add ‑es to the end to make it plural.
truss – trusses
bus – buses
marsh – marshes
lunch – lunches
tax – taxes
blitz – blitzes
3 In some cases, singular nouns ending in -s or -z, require that you double the -s or -z prior to adding the -es for pluralization.
fez – fezzes
gas –gasses
4If the noun ends with ‑f or ‑fe, the f is often changed to ‑ve before adding the -s to form the plural version.
wife – wives
wolf – wolves
Exceptions:
roof – roofs
belief – beliefs
chef – chefs
chief – chiefs
5 If a singular noun ends in ‑y and the letter before the -y is a consonant, change the ending to ‑ies to make the noun plural.
city – cities
puppy – puppies
6If the singular noun ends in -y and the letter before the -y is a vowel, simply add an -s to make it plural.
ray – rays
boy – boys
7If the singular noun ends in ‑o, add ‑es to make it plural.
potato – potatoes
tomato – tomatoes
Exceptions:
photo – photos
piano – pianos
halo – halos
8If the singular noun ends in ‑us, the plural ending is frequently ‑i.
cactus – cacti
focus – foci
9If the singular noun ends in ‑is, the plural ending is ‑es.
analysis – analyses
ellipsis – ellipses
10If the singular noun ends in ‑on, the plural ending is ‑a.
phenomenon – phenomena
criterion – criteria
11Some nouns don’t change at all when they’re pluralized.
sheep – sheep
series – series
species – species
deer –deer
Plural Noun Rules for Irregular Nouns
Irregular nouns follow no specific rules, so it’s best to memorize these or look up the proper pluralization in the dictionary.
A and AN is used when we speak of one person, place, animal or thing.
AN is used before naming words that begin with the vowel sounds a, e, i, o or u. Example: an apple, an egg, an orange, an elephant
A is used before naming words that begin with the consonant sounds b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z Example: a cat, a dog, a goat, a hat