Posts

Showing posts with the label programming

Everything you need to know about finding index of item in list with java

Image
In this article, we will discuss finding the index of the list. List<T> is an interface in java that provides many helpful methods for operating items of lists. The IndexOf() method returns the index of an item if the item found else it return -1. There are two methods we can use for finding index: indexOf(Object obj):- This method returns the first index of an item if it is present in the list. FindIndex.java import java.util.Arrays; import java.util.List; public class FindIndex { public static void main(String[] args) { List<String> list = Arrays.asList( "Are", "you", "programmer","?", "you", "are", "awesome!." ); String findMe = "you"; System.out.println("Index of "+ findMe +": " +list.lastIndexOf(findMe)); } } Ou...

java project swing analog clock program

This Analog Clock project is a swing java project. What should you know before start? what is java? what is javax.swing package swing GUI metaphors Q. what is java? A. Java is an object-oriented general-purpose programming language. It is intended to let application developers write once and run anywhere. Java is one of the most popular programming languages in use according to GitHub, particularly for client-server web applications. Java is designed by James Gosling and developed by Sun Microsystem. Q. What is swing? A. Swing is used to create window-based applications. It is built on the top of AWT (Abstract Windowing Toolkit) API and entirely written in java. Unlike AWT, Java Swing provides platform-independent and lightweight components. The javax.swing package provides classes for java swing API such as JButton, JTextField, JTextArea, JRadioButt...

String Programming set on java, kotlin, python, c and c++

Hey there! Here, you would find practice sets for string input output questions and their solutions that are solved in 5 different programming languages c , c++ , java , kotlin, and python . All programs have been tested. Program develop tools VS code - text editor Linux - operating system java 11 kotlin 1.7.32 python 3.7 g++ for c and c++ you can find all code at github click here What should you know before start what is string if else statement for each loop for java loop, nested loop 1 Input your name and print on console. Solution input : Enter your name: sagar output : ...

String input in c (with example)

A string is an array of characters in c, the string is written under the double quotes only. Even though any numeric or single alphabetical character written under the double quotes, all are considered as a string. Example: char str[] = "programz1000" These are three methods for getting input from the user:- scanf() -> We can input string by two ways with scanf() method: Syntex: scanf("%s",string) Example: #include<stdio.h> int main(){ char str[20]; scanf("%s",str); printf("%s",str); return 0; } Input: Programz rocks Output: Porgramz Note: In this program, It doesn't accept string after first space ...

Pattern Programming in c c++ java kotlin and python

Pattern Programming Here, you would find practice sets for some basic questions and there solutions that are solved in 5 different programming languages c , c++ , java , kotlin and python . All programs have been tested. Program develop tools VS code - text editor Linux - operating system java 11 kotlin CLI python 3.7 g++ for c and c++ Practicle 1 Pattern program 1 Solution output : * ** *** **** ***** c c++ Java Kotlin Python ...

Practice Programming Question Set-2

Hey there! Here, you would find practice sets for control statement questions and their solutions that are solved in 5 different programming languages c , c++ , java , kotlin, and python . All programs have been tested. Program develop tools VS code - text editor Linux - operating system java 11 kotlin 1.7.32 python 3.7 g++ for c and c++ you can find all code at Github 1 Write a program to find greater between three numbers. Solution input : num1 = 10 num2 = 5 num3 =7 output : Greater number:10 c c++ Java Kotlin Python package programjava; i...

Practice Basic Program Question Set -1

Welcome! Here, you would find practice sets for some basic questions and their solutions that are solved in 5 different programming languages c , c++ , java , kotlin, and python . All programs have been tested. Program develop tools VS code - text editor Linux - operating system java 11 kotlin CLI python 3.7 g++ for c and c++ you can find all code at Github Practical 1. Write a Hello world program Solution output : Hello, world! c c++ Java Kotlin Python class HelloWorld{ public static void main(String[] args)...