Posts

Showing posts from April, 2019

Variable Casting in Java

Example: String number; int number; double number; float number; Casting Variable to String:    toString(); String stringNum=number.toString(); this method can be used for casting int,double,float to a String. Casting Variable to int:   Integer.parseInt(variableName); int num = Integer.parseInt(number); Casting Variable to double:   Double.parseDouble(variableName); double num = Double.parseDouble(number); Casting Variable to float:   Float.parseFloat(variableName); float num = Float.parseFloat(number); *there are other methods too

Basic Commands in Command Prompt PC

Basic Commands in Command Prompt PC (Windows) For operating Folders (Folders:Directories) To open a folder - cd folderName To create a folder - mkdir folderName To delete a folder - rmdir folderName For operating Files: To open a file - start file.txt To create a file - copy nul file.txt (empty ! that is why "nul") To delete a file - del file.txt *In opening a file, using type of file the operating system (OS) opens the file with default application. For operating through Directories: To fallback to previous directory - cd.. To open other drive - e: (using drive letter (Local Disk E:))

Increase Productivity while Using Mobile Phone

Increase Productivity while Using Mobile Phone by managing Notifications. How many apps available in your phone? Most of them trigger notifications. Number of apps from which you want to get notified? So go to Settings and select Notifications then select app which you do not want to show notifications and toggle it to off/hide. This will improve your productivity. How this will work? Notifications are also called triggers which triggers an event to jump to the another app. Suppose you are reading a blog post on technical context for the purpose of your work.Suddenly a notification triggers and you need to take some action whether to click or collapse the notification, in doing any one of them you need to go off the concentration on your technical blog post. Notifications most of times creates emotional triggers.So thereby managing the notifications you can solely concentrate on one work and increase your productivity.

Tech News

Tech News

Hello World in HTML

<html> <head> </head> <body> <p> Hello World! Tech Uplift</p> </body> </html>

Variables in Kolin Android Studio

Declaring of Variables in Kotlin using Android Studio:  val is used to declare a variable in Kotlin val is immutable i.e. it cannot be reassigned after it is declared. Method 1: val name: String val number: int val number: float val number: double val state: boolean Now declaring values for variables name="Tech Uplift" number= 1 number= 1.006 number= 1.5 state=false In the method  above variables are explicitly declared .Saying that the type of variable should be declared first. Method 2: In this method variables are not declared explicitly. They are straight way declared. val name="Tech Uplift" val number= 1 val number= 1.006 val number= 1.5 val state=false Similarly var can be used but var is mutable can be changed even after it is declared.

How to set text for a TextView in Android using Android Studio

How to set text for a TextView in Android using Android Studio. Example : On button click set text for TextView: In Java: Step1: Declare String, TextView private String name="Tech Uplift"; private TextView textView; Step 2: Declare TextView in onCreate method. Step3: In on Click Method set like this: private void changeText(){ //this is the line that sets the text to the TextView textView.setText(name); } In Kotlin: Step1: Declare String, TextView val name: String  name="Tech Uplift"  TextView textView Step2: Declare TextView in onCreate method (optional) Step3: In on Click Method set like this: fun changeText(){ //this is the line that sets the text to the TextView textView.text=name } *in Kotlin semicolon operator not required.