Posts

Showing posts with the label Java

Enable WIFI ADAPTER Monitor Mode in Kali Linux

Connect the WIFI adapter and add it in VirtualBox USB Settings TP-Link TL-WN725N 150Mbps Wireless N Nano USB Adapter https://www.amazon.in/gp/product/B008IFXQFU Check the Adapter Chippet lsusb Bus 001 Device 002 : ID 2357 : 0109 TP-Link TL-WN823N v2 / v3 [Realtek RTL8192EU] Bus 001 Device 001 : ID 1 d6b: 0002 Linux Foundation 2 . 0 root hub Bus 002 Device 002 : ID 80 ee: 0021 VirtualBox USB Tablet Bus 002 Device 001 : ID 1 d6b: 0001 Linux Foundation 1 . 1 root hub Find Appropriate Driver for Realtek RTL8192EU from GitHub https://github.com/clnhub/rtl8192eu-linux Install the dependencies sudo apt install linux-headers-generic build-essential dkms git Clone the Driver git clone https://github.com/clnhub/rtl8192eu-linux.git Configure the Architecture and Monitor Mode Open MakeFile in Text Editor or Nano If you're using a different architecture than x86, the set (MakeFile) CONFIG_PLATFORM_I386_PC = n set your architecture CONFIG_PLATFORM_ARM_AARCH64...

Understanding Common Compile Time Errors in Java

What is an Error in Program? Errors are mistakes in a program that prevents it from working condition. Three types of error Compile Time Error Logical Error Runtime Error This document discusses the compile time and logical errors. Unresolved compilation problem Exception in thread "main" java.lang.Error: Unresolved compilation problem This happens when the public class keyword used other than Java File Name Example: Java File Name: Employee.java but public class is EmployeeTest Solution: File must be renamed as EmployeeTest.java class Employee { private String name; public Employee ( String name ) { this .name = name; } public String toString ( ) { return "Employee [name=" + name + "]" ; } } public class EmployeeTest { public static void main ( String[] args ) { System. out .println( new Employee( "Kumar" ).toString()); } } The method is undefined Reason-1: ...

Creating a Java Project using Visual Studio Code

Image
Visual Studio Code (VS Code) is the simple and lightweight editor that can be customized for any programming language. Microsoft provides a powerful VS Code plugin for Java Development. You need a stable JDK for developing Java Project. Java Development Kit (JDK): Bell Soft OpenJDK version 17 Editor: VS Code Install Bell Soft OpenJDK Download and install OpenJDK from the official website (64-Bit Full JDK) https://download.bell-sw.com/java/17.0.3.1+2/bellsoft-jdk17.0.3.1+2-windows-amd64-full.msi After installing the JDK, Go to Command window and check the java version, java -version Setting up the VS Code Editor Download Link: https://code.visualstudio.com/download After installing VS Code, Navigate extension icon and search by typing the keyword java Install Extension Pack for Java plugin from Microsoft Create a Java Project Press Ctrl+Shift+P -> Search java in popup then choose Java: Create Java Project option Select No Build Tools Now Choose the works...

Developing Java Servlet Web Application using Eclipse and Tomcat Server

Image
Servlet is a Java technology used for developing Web Applications and managed by a container called a servlet engine. It generates dynamic content and interacts with the client through Request and Response. Servlet extends the functionality of a web server. Java Servlet API is available in javax.servlet package. Web Application Architecture (Three Tier) Presentation Layer Client layer: to view the application) Application Layer Business Logic Layer : interacts with the Database layer and sends required information to the Presentation layer Data Layer The data is stored in this layer. The application layer communicates with the Database layer to retrieve the data Java Servlet Life-Cycle The Java Servlet Life cycle includes three stages, init() : gets invoked is when the servers are fired up service() : the service requests from the client end destroy() : Servlet performs the cleanup activities Creating Dynamic Web Project using Eclipse Download eclipse from th...

How to use JShell in Java?

JSHELL is the command line tools for Read/Evaluate/Print/Loop (REPL) Java Statements. It can be used for learning Java Concepts. The Java Statements executed in JSHELL is called as Snippets. To run, type jshell in Terminal/Command Window. Minimum Java Version? Minimum JDK9 version is required to use JSHELL JSHELL Commands /help - Getting help /exit - Exit JSHELL /list - List ALL Snippets /edit - Edit Snippet in Editor /save - Save Snippets into File /vars - List variables /imports - List imported packages /reset - Reset the current session Ctrl+l - Clear the Screen Ctrl+C - To exit from the current snippet Use as Calculator (Java Operators Demo) 10 + 20 100 * 3863 Create a String String str = "Hello" ; str .toUpperCase() str .length() Create a List Creatigng a Simple List Getting Dynamic Help of a Method (Press Tab after typing Char(s)) List.of() vs Arrays.asList() var myList = Arrays.asList( 4 , 5 , 3 , 1 , 2 ); myList.sort(Comparator...