<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ashutosh Dubey</title>
    <description>The latest articles on DEV Community by Ashutosh Dubey (@ashutoshdubey133).</description>
    <link>https://dev.to/ashutoshdubey133</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F370646%2F61286a65-4e41-4806-b6a3-59027ae99540.jpeg</url>
      <title>DEV Community: Ashutosh Dubey</title>
      <link>https://dev.to/ashutoshdubey133</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashutoshdubey133"/>
    <language>en</language>
    <item>
      <title>Java Factory Pattern with example Explained</title>
      <dc:creator>Ashutosh Dubey</dc:creator>
      <pubDate>Sat, 17 Dec 2022 12:53:02 +0000</pubDate>
      <link>https://dev.to/ashutoshdubey133/java-factory-pattern-with-example-explained-2hk8</link>
      <guid>https://dev.to/ashutoshdubey133/java-factory-pattern-with-example-explained-2hk8</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;The factory pattern is a creational design pattern in Java that provides an interface for creating objects in a super class, but allows subclasses to alter the type of objects that will be created.&lt;/p&gt;

&lt;p&gt;One of the main benefits of using the factory pattern is that it allows for the creation of objects without the client specifying the exact class of object that will be created. This is useful when the client does not need to know the implementation details of the objects being created, or when there is the possibility of adding new types of objects in the future.&lt;/p&gt;

&lt;p&gt;To implement the factory pattern in Java, you need to create a factory interface and concrete classes that implement the interface. The factory interface should have a method for creating objects, which will be implemented by the concrete classes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;For example, consider a simple application that allows users to create and customize their own cars. The application has three types of cars: sedan, hatchback, and SUV. We can implement the factory pattern by creating a CarFactory interface with a createCar() method, and concrete classes SedanFactory, HatchbackFactory, and SUVFactory that implement the CarFactory interface and create specific types of cars.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface CarFactory {
    public Car createCar();
}

public class SedanFactory implements CarFactory {
    public Car createCar() {
        return new Sedan();
    }
}

public class HatchbackFactory implements CarFactory {
    public Car createCar() {
        return new Hatchback();
    }
}

public class SUVFactory implements CarFactory {
    public Car createCar() {
        return new SUV();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use the factory pattern, the client can simply create an instance of the appropriate factory and call the createCar() method to create a new car. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CarFactory factory = new SedanFactory();
Car car = factory.createCar();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows the client to create a sedan without having to specify the exact class of the object that will be created. If the application needs to support additional types of cars in the future, all that is required is to create a new factory class that implements the CarFactory interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The factory pattern is a useful way to create objects in a flexible and extensible manner, and is particularly useful when the exact type of object to be created is not known at compile-time. It can also help to reduce the coupling between the client and the implementation classes of the objects being created.&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is singleton class in Java and how to implement it?</title>
      <dc:creator>Ashutosh Dubey</dc:creator>
      <pubDate>Tue, 13 Dec 2022 06:52:10 +0000</pubDate>
      <link>https://dev.to/ashutoshdubey133/what-is-singleton-class-in-java-and-how-to-implement-it-2emg</link>
      <guid>https://dev.to/ashutoshdubey133/what-is-singleton-class-in-java-and-how-to-implement-it-2emg</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;A singleton class in Java is a type of class that can have only one instance at any given time. This is useful in ensuring that only one object of a particular class is ever created and used in an application, avoiding duplication of resources and improving performance.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Implement Singleton Class??
&lt;/h3&gt;

&lt;p&gt;To implement a singleton class in Java, you need to make the class constructor private, so that no other class can create its own instance. You also need to declare a static instance of the class and initialize it in a static block. Finally, you need to create a public static method that returns the singleton instance.&lt;/p&gt;

&lt;p&gt;To illustrate this, let's say we want to create a singleton class called Logger that logs messages to the console. &lt;br&gt;
First, we'll make the class constructor private so that no other class can create its own instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private Logger() {

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we'll declare a static instance of the class and initialize it in a static block:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private static Logger instance = null;

static {
    instance = new Logger();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, we'll create a public static method that returns the singleton instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public static Logger getInstance() {
    return instance;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can use the Logger class to log messages to the console. All other classes will be able to access the same instance of the Logger class, ensuring that no duplicate instances are created.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;By using the singleton pattern, developers can ensure that only one instance of a particular class is ever created and used in an application, avoiding duplication of resources and improving performance.&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Creating a simple CRUD app on Spring Boot using H2, Hibernate</title>
      <dc:creator>Ashutosh Dubey</dc:creator>
      <pubDate>Mon, 12 Dec 2022 20:48:30 +0000</pubDate>
      <link>https://dev.to/ashutoshdubey133/creating-a-simple-crud-app-on-spring-boot-using-h2-hibernate-o3p</link>
      <guid>https://dev.to/ashutoshdubey133/creating-a-simple-crud-app-on-spring-boot-using-h2-hibernate-o3p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Creating a CRUD (Create, Read, Update, Delete) application on Spring Boot using H2, Hibernate is a great way to quickly develop a powerful and efficient web application. In this tutorial, we will walk through the steps of creating a simple CRUD application on Spring Boot using H2, Hibernate. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before starting this tutorial, you should have the following installed: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java 8 or higher&lt;/li&gt;
&lt;li&gt;Apache Maven 3.x&lt;/li&gt;
&lt;li&gt;Eclipse IDE &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should also have a basic understanding of the Spring Boot framework and the H2 and Hibernate databases. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create a Spring Boot Project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first step to creating a CRUD application on Spring Boot using H2, Hibernate is to create a Spring Boot project. To do this, open the Eclipse IDE and select “File &amp;gt; New &amp;gt; Spring Starter Project” from the menu bar. &lt;/p&gt;

&lt;p&gt;In the next window, enter a project name, choose the language as Java, and select the Spring Boot version. Then, click “Next”.&lt;/p&gt;

&lt;p&gt;On the next screen, select the dependencies for your project. For this tutorial, we will choose “Web”, “H2 Database”, and “JPA (Hibernate)”. Click “Finish” to create the project. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create the Database Tables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that we have our project created, we need to create the database tables. To do this, open the “application.properties” file located in the “src/main/resources” folder. &lt;/p&gt;

&lt;p&gt;In this file, we will set the database URL, username, and password. For this tutorial, we will use “jdbc:h2:mem:testdb” as the database URL. Set the username and password as “sa”. &lt;/p&gt;

&lt;p&gt;Next, we will create the database tables. To do this, create a new file called “schema.sql” in the “src/main/resources” folder. In this file, we will write the SQL code to create the database tables. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CREATE TABLE users ( 
  id INTEGER PRIMARY KEY, 
  name VARCHAR(255), 
  email VARCHAR(255)
);

CREATE TABLE posts ( 
  id INTEGER PRIMARY KEY, 
  title VARCHAR(255), 
  content VARCHAR(255)
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create the Entity Classes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next step is to create the entity classes. These classes will be used to map the database tables to Java objects. &lt;/p&gt;

&lt;p&gt;Create a new package called “entities” in the “src/main/java” folder. In this package, create two classes called “User” and “Post”. &lt;/p&gt;

&lt;p&gt;For the User class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Entity
public class User {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  private String name;
  private String email;

  // Getters and setters

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the Post class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Entity
public class Post {

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Long id;

  private String title;
  private String content;

  // Getters and setters

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Create the Repository Classes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next step is to create the repository classes. These classes will be used to access the database and perform CRUD operations. &lt;/p&gt;

&lt;p&gt;Create a new package called “repositories” in the “src/main/java” folder. In this package, create two classes called “UserRepository” and “PostRepository”. &lt;/p&gt;

&lt;p&gt;For the UserRepository class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Repository
public interface UserRepository extends JpaRepository&amp;lt;User, Long&amp;gt; {

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the PostRepository class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Repository
public interface PostRepository extends JpaRepository&amp;lt;Post, Long&amp;gt; {

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Create the Service Classes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The next step is to create the service classes. These classes will be used to manage the data and perform operations. &lt;/p&gt;

&lt;p&gt;Create a new package called “services” in the “src/main/java” folder. In this package, create two classes called “UserService” and “PostService”. &lt;/p&gt;

&lt;p&gt;For the UserService class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Service
public class UserService {

  @Autowired
  private UserRepository userRepository;

  public List&amp;lt;User&amp;gt; getAllUsers() {
    return userRepository.findAll();
  }

  public User getUserById(Long id) {
    return userRepository.findById(id).get();
  }

  public User createUser(String name, String email) {
    User user = new User();
    user.setName(name);
    user.setEmail(email);
    return userRepository.save(user);
  }

  public User updateUser(Long id, String name, String email) {
    User user = userRepository.findById(id).get();
    user.setName(name);
    user.setEmail(email);
    return userRepository.save(user);
  }

  public void deleteUser(Long id) {
    userRepository.deleteById(id);
  }

}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the PostService class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Service
public class PostService {

  @Autowired
  private PostRepository postRepository;

  public List&amp;lt;Post&amp;gt; getAllPosts() {
    return postRepository.findAll();
  }

  public Post getPostById(Long id) {
    return postRepository.findById(id).get();
  }

  public Post createPost(String title, String content) {
    Post post = new Post();
    post.setTitle(title);
    post.setContent(content);
    return postRepository.save(post);
  }

  public Post updatePost(Long id, String title, String content) {
    Post post = postRepository.findById(id).get();
    post.setTitle(title);
    post.setContent(content);
    return postRepository.save(post);
  }

  public void deletePost(Long id) {
    postRepository.deleteById(id);
  }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 6: Create the Controller Classes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The final step is to create the controller classes. These classes will be used to map the requests to the service classes. &lt;/p&gt;

&lt;p&gt;Create a new package called “controllers” in the “src/main/java” folder. In this package, create two classes called “UserController” and “PostController”. &lt;/p&gt;

&lt;p&gt;For the UserController class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@RestController
@RequestMapping("/users")
public class UserController {

  @Autowired
  private UserService userService;

  @GetMapping
  public List&amp;lt;User&amp;gt; getAllUsers() {
    return userService.getAllUsers();
  }

  @GetMapping("/{id}")
  public User getUserById(@PathVariable Long id) {
    return userService.getUserById(id);
  }

  @PostMapping
  public User createUser(@RequestBody User user) {
    return userService.createUser(user.getName(), user.getEmail());
  }

  @PutMapping("/{id}")
  public User updateUser(@PathVariable Long id, @RequestBody User user) {
    return userService.updateUser(id, user.getName(), user.getEmail());
  }

  @DeleteMapping("/{id}")
  public void deleteUser(@PathVariable Long id) {
    userService.deleteUser(id);
  }

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the PostController class, add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`@RestController
@RequestMapping("/posts")
public class PostController {

  @Autowired
  private PostService postService;

  @GetMapping
  public List&amp;lt;Post&amp;gt; getAllPosts() {
    return postService.getAllPosts();
  }

  @GetMapping("/{id}")
  public Post getPostById(@PathVariable Long id) {
    return postService.getPostById(id);
  }

  @PostMapping
  public Post createPost(@RequestBody Post post) {
    return postService.createPost(post.getTitle(), post.getContent());
  }

  @PutMapping("/{id}")
  public Post updatePost(@PathVariable Long id, @RequestBody Post post) {
    return postService.updatePost(id, post.getTitle(), post.getContent());
  }

  @DeleteMapping("/{id}")
  public void deletePost(@PathVariable Long id) {
    postService.deletePost(id);
  }

}`

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this tutorial, we have walked through the steps of creating a simple CRUD application on Spring Boot using H2, Hibernate. We have created our project, created the database tables, created the entity classes, created the repository classes, created the service classes, and created the controller classes. &lt;/p&gt;

&lt;p&gt;With this application, we can now easily create, read, update, and delete data using the H2 and Hibernate databases.&lt;/p&gt;

</description>
      <category>java</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>5 projects to learn Spring Boot as a Beginner</title>
      <dc:creator>Ashutosh Dubey</dc:creator>
      <pubDate>Mon, 12 Dec 2022 20:38:48 +0000</pubDate>
      <link>https://dev.to/ashutoshdubey133/5-projects-to-learn-spring-boot-as-a-beginner-44d3</link>
      <guid>https://dev.to/ashutoshdubey133/5-projects-to-learn-spring-boot-as-a-beginner-44d3</guid>
      <description>&lt;p&gt;Are you a budding coder interested in learning the beloved Spring Boot? It’s a great idea to learn the popular framework that is used by many large enterprises today. It’s a particularly useful framework for Java developers and can help you create stand-alone applications quickly and easily.&lt;/p&gt;

&lt;p&gt;If you’re a beginner to Spring Boot, there are some great projects that you can take on to help you become more familiar with the framework. Here are five great projects to get you started:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Create a Simple Spring Boot Application.&lt;/strong&gt; This is a great project for beginners to start with as it will help you get familiar with the basics of the framework. You’ll be able to learn the basics such as setting up a web application, configuring databases and more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Build a RESTful Web Service.&lt;/strong&gt; This project will teach you how to create a web service using the Spring Boot framework. You’ll learn how to define endpoints and how to communicate with them using the HTTP protocol.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Work with Spring Boot Security.&lt;/strong&gt; This project will help you learn how to secure your application using Spring Boot. You’ll learn how to configure authentication and authorization, as well as how to use Spring Security to protect your application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Create a Spring Boot Microservice.&lt;/strong&gt; This project will introduce you to the world of microservices and how to use them in your application. You’ll learn how to build a simple microservice using the Spring Boot framework, as well as how to deploy it to a cloud provider.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Build an Event-Driven Application.&lt;/strong&gt; This project will teach you the basics of event-driven architecture and how to use it with Spring Boot. You’ll learn how to create an event-driven application that can respond to events and take appropriate actions.&lt;/p&gt;

&lt;p&gt;These five projects are great for getting started with Spring Boot. They will help you become more familiar with the framework and get you ready to start building real-world applications with it. Good luck on your coding journey!&lt;/p&gt;

</description>
      <category>vite</category>
      <category>tailwindcss</category>
      <category>discuss</category>
    </item>
    <item>
      <title>No, File Name and Class Name do NOT need to be same in Java. Here’s How.</title>
      <dc:creator>Ashutosh Dubey</dc:creator>
      <pubDate>Thu, 05 Aug 2021 08:27:08 +0000</pubDate>
      <link>https://dev.to/ashutoshdubey133/no-file-name-and-class-name-do-not-need-to-be-same-in-java-here-s-how-5e4f</link>
      <guid>https://dev.to/ashutoshdubey133/no-file-name-and-class-name-do-not-need-to-be-same-in-java-here-s-how-5e4f</guid>
      <description>&lt;p&gt;The very first thing I was told in my java class was that the names of the .java file and the Class in java need to be same. But soon I learned it is actually a good practice to do so, but not mandatory at all.&lt;br&gt;
Let us create a simple Hello world Java program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Main{
    public static void main(String[] args){
        System.out.println("Hello World");
        }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file as “Hello.java” (Class name is Main).&lt;br&gt;
Now, open your terminal and give command to compile as you would normally:&lt;br&gt;
&lt;code&gt;javac Hello.java&lt;/code&gt;&lt;br&gt;
and then when you want to execute, instead of typing:&lt;br&gt;
&lt;code&gt;java Hello&lt;/code&gt;&lt;br&gt;
we need to type:&lt;br&gt;
&lt;code&gt;java Main&lt;/code&gt;&lt;br&gt;
As you would see, our program got executed easily.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M7Am1ZlO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghagpfuq4qek6ml11g3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M7Am1ZlO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghagpfuq4qek6ml11g3b.png" alt="Screenshot of Terminal"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔴🚫&lt;em&gt;&lt;strong&gt;EDIT&lt;/strong&gt;🔴🚫 - As mentioned by &lt;a href="https://dev.to/wldomiciano"&gt;@wldomiciano&lt;/a&gt;, if you declare the class as &lt;strong&gt;public&lt;/strong&gt;, then it is mandatory to name both the class and file name exactly same.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;At the time of execution, we just need to mention class name. Therefore, it is always advised to name the file and class alike, to not create any confusion. But as you saw, it is not a mandatory thing.&lt;/p&gt;

</description>
      <category>java</category>
    </item>
    <item>
      <title>Answer Questions and Earn Money on Chegg</title>
      <dc:creator>Ashutosh Dubey</dc:creator>
      <pubDate>Thu, 24 Dec 2020 18:54:47 +0000</pubDate>
      <link>https://dev.to/ashutoshdubey133/answer-questions-and-earn-money-on-chegg-lk4</link>
      <guid>https://dev.to/ashutoshdubey133/answer-questions-and-earn-money-on-chegg-lk4</guid>
      <description>&lt;p&gt;In this article I will show you how to apply for a Q&amp;amp;A expert on &lt;strong&gt;Chegg&lt;/strong&gt; and start earning some money.&lt;br&gt;
This article is about how you your knowledge in a subject can lead you to earn some money.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is Chegg?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Chegg is an website where students can ask questions and get their answers written by an expert. This is where we come in.&lt;br&gt;
We have to answer the question and can make money for each question that we answer.&lt;br&gt;
The money per question can vary, but in India on an average you can get around &lt;strong&gt;₹150 for each question&lt;/strong&gt;, which is around 2$.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How To Apply&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Prerequisite&lt;/strong&gt; - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You should be a undergraduate student or have a undergraduate degree.&lt;/li&gt;
&lt;li&gt;Should have intermediate knowledge of the subject.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: Go to &lt;a href="https://experthiring.cheggindia.com"&gt;experthiring.cheggindia.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: Signup and accept the guidelines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: Now proceed for Registration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;The subject you choose in registration is final &lt;br&gt;
and cannot be changed, and you will be asked questions on that subject. &lt;br&gt;
So makeup your mind in advance, &lt;br&gt;
and then head for registration.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;: After completing registration, attempt the test.&lt;br&gt;
Some Notes about the test:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It has no time limit. Take your time and complete it.&lt;/li&gt;
&lt;li&gt;They will e-mail you the passing criteria.(It was 50% for me).&lt;/li&gt;
&lt;li&gt;There are around 10-12 questions in the test.&lt;/li&gt;
&lt;li&gt;The questions are not very hard, but they do test your basic understanding.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;: After the test, DO READ THE GUIDELINES. And only then attempt the guidelines test. It is an easy one but do read the guidelines once. Around 20 questions were asked from me.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After completing the guidelines test, submit all the asked documents and then wait for their email. I got it in 1 day. It will mention the date you can start answering the questions. I applied on December and got the date for February. &lt;br&gt;
So apply fast, because the seats are limited.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>career</category>
    </item>
  </channel>
</rss>
