This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SubstringExample{ | |
public static void main(String args[]){ | |
String s1="javatpoint"; | |
System.out.println(s1.substring(2,4));//returns va | |
System.out.println(s1.substring(2));//returns vatpoint | |
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class IndexOfExample{ | |
public static void main(String args[]){ | |
String s1="this is index of example"; | |
//passing substring | |
int index1=s1.indexOf("is");//returns the index of is substring | |
int index2=s1.indexOf("index");//returns the index of index substring | |
System.out.println(index1+" "+index2);//2 8 | |
//passing substring with from index | |
int index3=s1.indexOf("is",4);//returns the index of is substring after 4th index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>Javascript gravity</title> | |
<style> | |
* { padding: 0; margin: 0; } | |
canvas { background: #eee; display: block; margin: 0 auto; } | |
</style> | |
</head> | |
<body onload="init()"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>Names</title> | |
<style> | |
* { padding: 2; margin: 2; } | |
canvas { background: #eee; display: block; margin: 0 auto; } | |
</style> | |
</head> | |
<body onload="init()"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class ArrListExample { | |
public static void main(String[] args) { | |
Scanner userInput = new Scanner(System.in); | |
ArrayList<String> cityPop = new ArrayList<String>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
import java.awt.geom.AffineTransform; | |
import java.awt.image.*; | |
import javax.imageio.*; | |
import javax.swing.*; | |
import java.awt.AlphaComposite; | |
import java.awt.Graphics2D; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
//STARTER CLASS | |
public class StudentStarter | |
{ | |
public StudentStarter() | |
{ | |
Student s; | |
Scanner sc=new Scanner(System.in); | |
int currYear = 2018; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.swing.JFrame; | |
public class ImageStarter extends JFrame { | |
public ImageStarter() | |
{ | |
add(new ImageFilter()); | |
setTitle("Image Filter"); | |
setDefaultCloseOperation(EXIT_ON_CLOSE); | |
setSize(800,500); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.MouseListener; | |
import java.awt.event.MouseEvent; | |
import java.awt.Color; | |
import java.awt.Dimension; | |
import java.awt.Font; | |
import java.awt.FontMetrics; | |
import java.awt.Graphics; | |
import java.awt.Toolkit; | |
import java.awt.event.KeyAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
import java.awt.geom.AffineTransform; | |
import java.awt.image.*; | |
import javax.imageio.*; | |
import javax.swing.*; | |
import java.awt.AlphaComposite; | |
import java.awt.Graphics2D; |
OlderNewer