Posts

Showing posts with the label Java Demo

Array Practice-Insert Element At Given Position

import java.util.*; public class insertElementAtGivenPosition {        static void insertElementInArray(int array[], int noToInsert, int positionToInsert, int arrayLength)    {      for(int i = arrayLength -1; i > positionToInsert; i--)      {        array[i] = array[i-1];      }      array[positionToInsert] = noToInsert;    }           public static void main(String[] args) {              int array[] = new int[4];       array[0] = 1;       array[1] = 2;              int noToInsert = 3;       int positionToInsert = 2;              int arrayLength = array.length;       System.out.println("Befor array");       for(int i = 0; i < arrayLength; i++)   ...

Part-1 | Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library

Hello Dear Friends, I hope you are doing Good.!! Today we are going to see a very interesting article. And the topic name is ‘ Part-1 | Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library & TestNG ’. Below I am mentioning the Agenda of this topic. Agenda 1) What is Rest-assured? 2) Why need Rest-Assured? 3) Required Pre-requisites  4) Steps to setup Rest-assured project 5) Practical demo by using different request types  GET POST PUT DELETE Will see and discuss each point as mentioned above and to watch on YouTube channel please click on below video . 1) What is Rest-assured? REST Assured is a Java Domain Specific Language API for simplifying testing of RESTful web services.  REST Assured API can be used to invoke REST web services and match response content to test them.  Rest Assured has methods to fetch data from almost every part of the request and response no mat...

Part-3 | Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library

Hello Dear Friends, I hope you are doing Good.!! Today we are going to see a very interesting article. And the topic name is ‘ Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library ’ So below I am mentioning the agenda of today's article. Agenda:  1) How to write RestAssured Code in eclipse IDE and what are the steps. 2) How to get response from different APIs using RestAssured. 3) How to use different request types as mentioned below in RestAssured and how to      get response using mentioned request. - PUT - DELETE 4) How to validate status code of response Guys above mentioned points we have explained on YouTube channel for the better understanding. Guys to read introduction part and Part-2 of this article click on given URL   Part -1 Introduction Part   and  Part-2   and to watch today's demo on YouTube channel please click on below video.

Print Hello World In Different Programming Languages | Boost Coding Skill | Developer Life

Hello Dear Friends, I hope you are doing Good.!! In this tutorial we are going to see a very interesting topic and this is  Print #Hello #World In Different Programming Languages . So have created a video on our YouTube channel and in this video you will get different syntax of various programming languages to print 'Hello World' . You will get syntax for the below mentioned programming languages. 1) Java 2) Swift 3) C 4) C++ 5) PHP 6) Python 7) Visual Basic 8) .Net 9) Bash 10) C# 11) CopyScript 12) JavaScript 13) JQuery 14) Julia 15) Objective-C 16) Matlab 17) Pascal 18) R 19) Perl 5 20) VbScript To watch on YouTube channel click on YouTube URL. Video Link Please visit on our different platform: 👇 Blog Site          :  https://socialtechhelpline.blogspot.com Facebook Channel   :  https://fb.me/socialtechhelpline Instagram Channel :   https://www.instagram.com/jobsmails18 LinkedIn           :...

Part-2 | Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library

Image
Hello Dear Friends, I hope you are doing Good.!! Today we are going to see a very interesting article. And the topic name is ‘ Perform API Testing or Automation of Rest APIs/Web Services using Rest-assured Java Library ’ So below I am mentioning the agenda of today's article. Agenda:  1) How to write RestAssured Code in eclipse IDE and what are the steps. 2) How to get response from different APIs using RestAssured. 3) How to use different request types as mentioned below in RestAssured and how to      get response using mentioned request. - GET - POST 4) How to validate status code of response Guys above mentioned points we have explained on YouTube channel for the better understanding. Guys to read introduction part of this article click on given URL Part -1 Introduction Part   and to watch today's demo on YouTube channel please click on below video. Guys remaining part will cover the next ...

Part-2 | Top Most Asked And Important 20 Java Interview Questions And Answers| Build Your Tech Skill

Image
Hello Dear Friends, I hope you are doing Good! In this article we are going to see most asked and important 20 java interview questions and their answers. And guys for the better understanding we have explained all thirty questions on our YouTube Chanel. I will share you the link and also there you can find another videos which will helpful to you.

Most Asked & Important 30 Java Interview Questions And Answers | Build Your Technical Skill | Part-1

Image
Hello Dear Friends, I hope you are doing Good! In this article we are going to see most asked and important thirty java interview questions and their answers. And guys for the better understanding we have explained all thirty questions on our YouTube Chanel. I will share you the link and also there you can find another videos which will helpful to you.

MCQ questions for graphics class method in Java

Introduction of Graphics class in Java : The Graphics class is in java is the abstract base class for all graphics contexts. A Graphics object encapsulates state information needed for the basic rendering operations that Java supports. A Graphics class is allow an application to draw onto components that are realized on various devices, as well as onto off-screen images.  MCQ questions for graphics class method in Java : 1. The Graphics class is the_____for all graphics contexts.      a) Main class      b) Abstract super class       c) Super class      d) Object class Answer : b) Abstract super class  2. The Graphics class is resides in_____      a) java.util      b) java.lang      c) java.applet      d) java.awt Answer: d) java.awt  3. Syntax to create new Graphics object is c...

Simple Java Code To Read Password Protected XLSX File

package com.techhelpline.PractiseCode; import java.io.File; import java.io.InputStream; import java.util.Iterator; import org.apache.poi.poifs.crypt.Decryptor; import org.apache.poi.poifs.crypt.EncryptionInfo; import org.apache.poi.poifs.filesystem.NPOIFSFileSystem; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class ReadProtectedFileXLSX { public static void main(String[] args) { String inputFilePath = "UserDetails.xlsx"; String password = "test"; try { NPOIFSFileSystem fileSystem = new NPOIFSFileSystem(new File(inputFilePath)); EncryptionInfo info = new EncryptionInfo(fileSystem); Decryptor decryptor = Decryptor.getInstance(info); if (!decryptor.verifyPassword(password)) { System.out.println("File in password protected."); ...

Simple Java Code To Read Password Protected XLS File

package com.techhelpline.PractiseCode; import java.io.File; import java.io.IOException; import java.util.Iterator; import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.NPOIFSFileSystem; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; public class ReadProtectedFileXLS { public static void main(String[] args) throws IOException { String inputFilePath = "UserDetails.xls"; String password="test"; NPOIFSFileSystem fileSystem = new NPOIFSFileSystem(new File(inputFilePath), true); Biff8EncryptionKey.setCurrentUserPassword(password); Workbook workbook = new HSSFWorkbook(fileSystem); Sheet firstSheet = workbook.getSheetAt(0); Iterator<Row> iterator = firstSheet.iterator(); while (iterator.hasNext()) { ...

Simple Demo of How To Use Config Properties File In JAVA Project Using Eclipse IDE|With Selenium Ex

Image
Video Description : ----------------- ================= Questions ================ 1. How To Use Config Properties File In JAVA Project. 2. How to read Config Properties File and how to use parameters in application. Automate the application using selenium and Maven repository. 3. How to create Config Properties File. ================ Description =============== 1. The '.properties' files are mainly used in Java programs to maintain project configuration data, database config etc.  2. Each parameter in properties file are stored as a pair of strings, in key and value format, where each key is on one line.  3. You can easily read properties from some file using object of type Properties.